feat: refactor delete user mutation with the REST API endpoint

This commit is contained in:
kasia.oczkowska
2024-07-18 10:14:46 +01:00
committed by Faruk AYDIN
parent 0e26032ac3
commit 1aa1f441b3
7 changed files with 25 additions and 46 deletions

View File

@@ -0,0 +1,15 @@
import { useMutation } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useAdminUserDelete(userId) {
const mutation = useMutation({
mutationFn: async () => {
const { data } = await api.delete(`/v1/admin/users/${userId}`);
return data;
},
});
return mutation;
}