feat: refactor reset password mutation with the REST API endpoint
This commit is contained in:
15
packages/web/src/hooks/useResetPassword.js
Normal file
15
packages/web/src/hooks/useResetPassword.js
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user