feat: refactor forgot password mutation with the REST API endpoint

This commit is contained in:
kasia.oczkowska
2024-07-17 13:23:45 +01:00
parent 778559d537
commit 46ec9b5229
8 changed files with 39 additions and 70 deletions

View File

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