mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -05:00
chore(console): update incorrect swr cache key usages (#5724)
This commit is contained in:
parent
368385b93d
commit
46b3c77c8f
5 changed files with 6 additions and 6 deletions
|
@ -56,7 +56,7 @@ function Invitations() {
|
|||
const { canInviteMember, canRemoveMember } = useCurrentTenantScopes();
|
||||
|
||||
const { data, error, isLoading, mutate } = useSWR<TenantInvitationResponse[], RequestError>(
|
||||
'api/tenants/:tenantId/invitations',
|
||||
`api/tenants/${currentTenantId}/invitations`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/invitations', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
|
|
|
@ -24,7 +24,7 @@ const useEmailInputUtils = () => {
|
|||
);
|
||||
|
||||
const { data: existingInvitations = [] } = useSWR<TenantInvitationResponse[], RequestError>(
|
||||
'api/tenants/:tenantId/invitations',
|
||||
`api/tenants/${currentTenantId}/invitations`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/invitations', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
|
|
|
@ -27,7 +27,7 @@ function Members() {
|
|||
const { canRemoveMember, canUpdateMemberRole } = useCurrentTenantScopes();
|
||||
|
||||
const { data, error, isLoading, mutate } = useSWR<TenantMemberResponse[], RequestError>(
|
||||
`api/tenants/:tenantId/members`,
|
||||
`api/tenants/${currentTenantId}/members`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/members', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
|
|
|
@ -18,12 +18,12 @@ const useTenantMembersUsage = () => {
|
|||
const cloudApi = useAuthedCloudApi();
|
||||
|
||||
const { data: members } = useSWR<TenantMemberResponse[], RequestError>(
|
||||
`api/tenants/:tenantId/members`,
|
||||
`api/tenants/${currentTenantId}/members`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/members', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
const { data: invitations } = useSWR<TenantInvitationResponse[], RequestError>(
|
||||
canInviteMember && 'api/tenants/:tenantId/invitations',
|
||||
canInviteMember && `api/tenants/${currentTenantId}/invitations`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/invitations', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
|
|
|
@ -39,7 +39,7 @@ function TenantMembers() {
|
|||
const { currentTenantId } = useContext(TenantsContext);
|
||||
const cloudApi = useAuthedCloudApi();
|
||||
const { trigger: mutateInvitations } = useSWRMutation(
|
||||
'api/tenants/:tenantId/invitations',
|
||||
`api/tenants/${currentTenantId}/invitations`,
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/invitations', { params: { tenantId: currentTenantId } })
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue