Skip to content

Commit 1d1fc78

Browse files
authored
feat: update openAPI SHA and add fetchOrgCreationAllowance to UI (#6122)
1 parent da4826b commit 1d1fc78

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"cy": "CYPRESS_dexUrl=https://$INGRESS_HOST:$PORT_HTTPS CYPRESS_baseUrl=http://localhost:9999 cypress open",
5353
"cy:dev": "source ../monitor-ci/.env && CYPRESS_dexUrl=CLOUD CYPRESS_baseUrl=https://$INGRESS_HOST:$PORT_HTTPS cypress open --config testFiles='{cloud,shared}/**/*.*'",
5454
"cy:dev-oss": "source ../monitor-ci/.env && CYPRESS_dexUrl=OSS CYPRESS_baseUrl=https://$INGRESS_HOST:$PORT_HTTPS cypress open --config testFiles='{oss,shared}/**/*.*'",
55-
"generate": "export SHA=f495434ca24ea945785919934e330b3138de03a7 && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta",
55+
"generate": "export SHA=4b8c02d04b82958996096a965b2e1c078f031763 && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta",
5656
"generate-local": "export REMOTE=../openapi/ && yarn generate-meta",
5757
"generate-local-cloud": "export REMOTE=../openapi/ && yarn generate-meta-cloud",
5858
"generate-meta": "if [ -z \"${CLOUD_URL}\" ]; then yarn generate-meta-oss; else yarn generate-meta-cloud; fi",

src/identity/apis/org.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import {
33
getAccounts,
44
getAccountsOrgs,
5+
getAllowancesOrgsCreate,
56
getClusters,
67
getOrg,
78
postOrg,
@@ -117,6 +118,19 @@ export const fetchDefaultAccountDefaultOrg = async (): Promise<
117118
}
118119
}
119120

121+
// fetch data regarding whether the user can create new orgs, and associated upgrade options.
122+
export const fetchOrgCreationAllowance = async () => {
123+
const response = await getAllowancesOrgsCreate({})
124+
125+
if (response.status !== 200) {
126+
throw new GenericError(
127+
'Failed to determine whether this user can create a new organization.'
128+
)
129+
}
130+
131+
return response.data
132+
}
133+
120134
// fetch the list of organizations associated with a given account ID
121135
export const fetchOrgsByAccountID = async (
122136
accountNum: number

0 commit comments

Comments
 (0)