feat: refactor reset password mutation with the REST API endpoint

This commit is contained in:
kasia.oczkowska
2024-07-17 15:04:15 +01:00
parent 27610c002c
commit dd0a1328e8
8 changed files with 45 additions and 57 deletions

View File

@@ -0,0 +1,15 @@
import { useMutation } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useResetPassword() {
const mutation = useMutation({
mutationFn: async (payload) => {
const { data } = await api.post('/v1/users/reset-password', payload);
return data;
},
});
return mutation;
}