From 374f8a64fa91d1de83b6d7bbe43274bb9f13ef86 Mon Sep 17 00:00:00 2001 From: Piyush Gupta Date: Sat, 6 Dec 2025 22:44:05 +0530 Subject: [PATCH] fix: caching --- frontend/src/hooks/api/projects/query-keys.tsx | 3 ++- .../components/NavBar/NewSubOrganizationForm.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/hooks/api/projects/query-keys.tsx b/frontend/src/hooks/api/projects/query-keys.tsx index 6f8ebf970..6f74bf6f3 100644 --- a/frontend/src/hooks/api/projects/query-keys.tsx +++ b/frontend/src/hooks/api/projects/query-keys.tsx @@ -30,7 +30,8 @@ export const projectKeys = { // allows invalidation using above key without knowing params getProjectIdentityMembershipsWithParams: ({ projectId, ...params }: TListProjectIdentitiesDTO) => [...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, getProjectGroupMembershipDetails: (projectId: string, groupId: string) => [{ projectId, groupId }, "project-group-membership-details"] as const, diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/NewSubOrganizationForm.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/NewSubOrganizationForm.tsx index 48af0a737..6570b4314 100644 --- a/frontend/src/layouts/OrganizationLayout/components/NavBar/NewSubOrganizationForm.tsx +++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/NewSubOrganizationForm.tsx @@ -70,11 +70,11 @@ export const NewSubOrganizationForm = ({ onClose }: ContentProps) => { SecurityClient.setToken(token); SecurityClient.setProviderAuthToken(""); queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); - queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() }); + queryClient.removeQueries({ queryKey: subOrgQuery.queryKey }); await router.invalidate({ sync: true }).catch(() => null); - queryClient.removeQueries({ queryKey: subOrgQuery.queryKey }); await navigateUserToOrg({ navigate, organizationId: organization.id }); + queryClient.removeQueries({ queryKey: projectKeys.allProjectQueries() }); }; return (