0
Fork 0
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:
Charles Zhao 2024-04-16 21:32:43 +08:00 committed by GitHub
parent 368385b93d
commit 46b3c77c8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

View file

@ -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 } })
);

View file

@ -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 } })
);

View file

@ -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 } })
);

View file

@ -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 } })
);

View file

@ -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 } })
);