feat: resolved role issue in ui

This commit is contained in:
=
2024-10-25 00:59:40 +05:30
parent b6a1ab2376
commit 2afc6b133e
6 changed files with 10 additions and 7 deletions
+4 -1
View File
@@ -41,8 +41,11 @@ export const useUpdateProjectRole = () => {
} = await apiRequest.patch(`/api/v2/workspace/${projectId}/roles/${id}`, dto);
return role;
},
onSuccess: (_, { projectId }) => {
onSuccess: (_, { projectId, slug }) => {
queryClient.invalidateQueries(roleQueryKeys.getProjectRoles(projectId));
if (slug) {
queryClient.invalidateQueries(roleQueryKeys.getProjectRoleBySlug(projectId, slug));
}
}
});
};
+2 -2
View File
@@ -39,8 +39,8 @@ const conditionsMatcher = buildMongoQueryMatcher({ $glob }, { glob });
export const roleQueryKeys = {
getProjectRoles: (projectId: string) => ["roles", { projectSlug: projectId }] as const,
getProjectRoleBySlug: (projectSlug: string, roleSlug: string) =>
["roles", { projectSlug, roleSlug }] as const,
getProjectRoleBySlug: (projectId: string, roleSlug: string) =>
["roles", { projectId, roleSlug }] as const,
getOrgRoles: (orgId: string) => ["org-roles", { orgId }] as const,
getOrgRole: (orgId: string, roleId: string) => [{ orgId, roleId }, "org-role"] as const,
getUserOrgPermissions: ({ orgId }: TGetUserOrgPermissionsDTO) =>