Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: caching

Piyush Gupta374f8a64fa91
diff --git a/frontend/src/hooks/api/projects/query-keys.tsx b/frontend/src/hooks/api/projects/query-keys.tsx
index 6f8ebf970b..6f74bf6f3f 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 48af0a737b..6570b43147 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 (