fix: caching

This commit is contained in:
Piyush Gupta
2025-12-06 22:44:05 +05:30
parent 0aa5dd983c
commit 374f8a64fa
2 changed files with 4 additions and 3 deletions
@@ -30,7 +30,8 @@ export const projectKeys = {
// allows invalidation using above key without knowing params // allows invalidation using above key without knowing params
getProjectIdentityMembershipsWithParams: ({ projectId, ...params }: TListProjectIdentitiesDTO) => getProjectIdentityMembershipsWithParams: ({ projectId, ...params }: TListProjectIdentitiesDTO) =>
[...projectKeys.getProjectIdentityMemberships(projectId), params] as const, [...projectKeys.getProjectIdentityMemberships(projectId), params] as const,
searchProject: (dto: TSearchProjectsDTO) => ["search-projects", dto] as const, searchProject: (dto: TSearchProjectsDTO) =>
[...projectKeys.allProjectQueries(), "search-projects", dto] as const,
getProjectGroupMemberships: (projectId: string) => [{ projectId }, "project-groups"] as const, getProjectGroupMemberships: (projectId: string) => [{ projectId }, "project-groups"] as const,
getProjectGroupMembershipDetails: (projectId: string, groupId: string) => getProjectGroupMembershipDetails: (projectId: string, groupId: string) =>
[{ projectId, groupId }, "project-group-membership-details"] as const, [{ projectId, groupId }, "project-group-membership-details"] as const,
@@ -70,11 +70,11 @@ export const NewSubOrganizationForm = ({ onClose }: ContentProps) => {
SecurityClient.setToken(token); SecurityClient.setToken(token);
SecurityClient.setProviderAuthToken(""); SecurityClient.setProviderAuthToken("");
queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); queryClient.removeQueries({ queryKey: authKeys.getAuthToken });
queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() }); queryClient.removeQueries({ queryKey: subOrgQuery.queryKey });
await router.invalidate({ sync: true }).catch(() => null); await router.invalidate({ sync: true }).catch(() => null);
queryClient.removeQueries({ queryKey: subOrgQuery.queryKey });
await navigateUserToOrg({ navigate, organizationId: organization.id }); await navigateUserToOrg({ navigate, organizationId: organization.id });
queryClient.removeQueries({ queryKey: projectKeys.allProjectQueries() });
}; };
return ( return (