feat: role list section completed with delete

This commit is contained in:
=
2024-10-25 00:59:39 +05:30
parent 558a809b4c
commit 3e8f1d8de7
30 changed files with 444 additions and 53 deletions
@@ -365,6 +365,21 @@ export const useGetWorkspaceUsers = (workspaceId: string, includeGroupMembers?:
});
};
export const useGetWorkspaceUserDetails = (workspaceId: string, membershipId: string) => {
return useQuery({
queryKey: workspaceKeys.getWorkspaceUserDetails(workspaceId, membershipId),
queryFn: async () => {
const {
data: { membership }
} = await apiRequest.get<{ membership: TWorkspaceUser }>(
`/api/v1/workspace/${workspaceId}/memberships/${membershipId}`
);
return membership;
},
enabled: Boolean(workspaceId) && Boolean(membershipId)
});
};
export const useDeleteUserFromWorkspace = () => {
const queryClient = useQueryClient();