Skip to content

Commit 3df4fef

Browse files
dcoaarbrandes
authored andcommitted
fix: invalidate PermissionsByRole to update number of user in a role
1 parent a37491b commit 3df4fef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/authz-module/data/hooks.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const useAssignTeamMembersRole = () => {
8585
}) => assignTeamMembersRole(data),
8686
onSettled: (_data, _error, { data: { scope } }) => {
8787
queryClient.invalidateQueries({ queryKey: authzQueryKeys.teamMembersAll(scope) });
88+
queryClient.invalidateQueries({ queryKey: authzQueryKeys.permissionsByRole(scope) });
8889
},
8990
});
9091
};
@@ -104,6 +105,7 @@ export const useRevokeUserRoles = () => {
104105
}) => revokeUserRoles(data),
105106
onSettled: (_data, _error, { data: { scope } }) => {
106107
queryClient.invalidateQueries({ queryKey: authzQueryKeys.teamMembersAll(scope) });
108+
queryClient.invalidateQueries({ queryKey: authzQueryKeys.permissionsByRole(scope) });
107109
},
108110
});
109111
};

0 commit comments

Comments
 (0)