feat: use REST API endpoint to delete current user

This commit is contained in:
Ali BARIN
2024-09-18 15:36:09 +00:00
committed by Faruk AYDIN
parent b78be222d7
commit ed12465975
2 changed files with 23 additions and 4 deletions

View File

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