Delete membership by email

This commit is contained in:
Daniel Hougaard
2024-02-22 05:00:25 +01:00
parent d3d429db37
commit bf278355c4
2 changed files with 8 additions and 12 deletions
+4 -8
View File
@@ -337,16 +337,12 @@ export const useDeleteUserFromWorkspace = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async ({
membershipId,
workspaceId
}: {
workspaceId: string;
membershipId: string;
}) => {
mutationFn: async ({ emails, workspaceId }: { workspaceId: string; emails: string[] }) => {
const {
data: { deletedMembership }
} = await apiRequest.delete(`/api/v1/workspace/${workspaceId}/memberships/${membershipId}`);
} = await apiRequest.delete(`/api/v2/workspace/${workspaceId}/memberships`, {
data: { emails }
});
return deletedMembership;
},
onSuccess: (_, { workspaceId }) => {