mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): should not call cloud API when tenant ID is not valid (#6399)
This commit is contained in:
parent
2e3a0063ba
commit
a731b09122
3 changed files with 4 additions and 2 deletions
|
@ -8,7 +8,7 @@ const useNewSubscriptionQuota = (tenantId: string) => {
|
|||
const cloudApi = useCloudApi();
|
||||
|
||||
return useSWR<NewSubscriptionQuota, Error>(
|
||||
isCloud && isDevFeaturesEnabled && `/api/tenants/${tenantId}/subscription/quota`,
|
||||
isCloud && isDevFeaturesEnabled && tenantId && `/api/tenants/${tenantId}/subscription/quota`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/subscription/quota', {
|
||||
params: { tenantId },
|
||||
|
|
|
@ -14,6 +14,7 @@ const useNewSubscriptionScopeUsage = (tenantId: string) => {
|
|||
scopeResourceUsage: useSWR<NewSubscriptionScopeUsage, Error>(
|
||||
isCloud &&
|
||||
isDevFeaturesEnabled &&
|
||||
tenantId &&
|
||||
`/api/tenants/${tenantId}/subscription/usage/${resourceEntityName}/scopes`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/subscription/usage/:entityName/scopes', {
|
||||
|
@ -24,6 +25,7 @@ const useNewSubscriptionScopeUsage = (tenantId: string) => {
|
|||
scopeRoleUsage: useSWR<NewSubscriptionScopeUsage, Error>(
|
||||
isCloud &&
|
||||
isDevFeaturesEnabled &&
|
||||
tenantId &&
|
||||
`/api/tenants/${tenantId}/subscription/usage/${roleEntityName}/scopes`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/subscription/usage/:entityName/scopes', {
|
||||
|
|
|
@ -8,7 +8,7 @@ const useNewSubscriptionUsage = (tenantId: string) => {
|
|||
const cloudApi = useCloudApi();
|
||||
|
||||
return useSWR<NewSubscriptionUsage, Error>(
|
||||
isCloud && isDevFeaturesEnabled && `/api/tenants/${tenantId}/subscription/usage`,
|
||||
isCloud && isDevFeaturesEnabled && tenantId && `/api/tenants/${tenantId}/subscription/usage`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/subscription/usage', {
|
||||
params: { tenantId },
|
||||
|
|
Loading…
Reference in a new issue