Show new workspace role on change

This commit is contained in:
Philipinho
2024-07-22 16:35:00 +01:00
parent 407a1aff3b
commit 2bd6422a35
2 changed files with 4 additions and 3 deletions

View File

@ -53,9 +53,10 @@ export function useChangeMemberRoleMutation() {
return useMutation<any, Error, any>({
mutationFn: (data) => changeMemberRole(data),
onSuccess: (data, variables) => {
// TODO: change in cache instead
notifications.show({ message: "Member role updated successfully" });
queryClient.refetchQueries({
queryKey: ["workspaceMembers", variables.spaceId],
queryKey: ["workspaceMembers"],
});
},
onError: (error) => {