mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
fix(console): should stop requesting invitations api for collaborator role (#5650)
This commit is contained in:
parent
79645d7b9d
commit
77db93905d
1 changed files with 3 additions and 1 deletions
|
@ -7,11 +7,13 @@ import { type TenantInvitationResponse, type TenantMemberResponse } from '@/clou
|
|||
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
|
||||
import { TenantsContext } from '@/contexts/TenantsProvider';
|
||||
import { type RequestError } from '@/hooks/use-api';
|
||||
import useCurrentTenantScopes from '@/hooks/use-current-tenant-scopes';
|
||||
import { hasReachedQuotaLimit, hasSurpassedQuotaLimit } from '@/utils/quota';
|
||||
|
||||
const useTenantMembersUsage = () => {
|
||||
const { currentPlan } = useContext(SubscriptionDataContext);
|
||||
const { currentTenantId } = useContext(TenantsContext);
|
||||
const { canInviteMember } = useCurrentTenantScopes();
|
||||
|
||||
const cloudApi = useAuthedCloudApi();
|
||||
|
||||
|
@ -21,7 +23,7 @@ const useTenantMembersUsage = () => {
|
|||
cloudApi.get('/api/tenants/:tenantId/members', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
const { data: invitations } = useSWR<TenantInvitationResponse[], RequestError>(
|
||||
'api/tenants/:tenantId/invitations',
|
||||
canInviteMember && 'api/tenants/:tenantId/invitations',
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/invitations', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue