2025-01-21 20:33:05 +03:00
|
|
|
import { useMutation } from '@tanstack/react-query';
|
|
|
|
|
|
|
|
import { authApi, IRequestPasswordDTO } from './api';
|
|
|
|
|
|
|
|
export const useRequestPasswordReset = () => {
|
|
|
|
const mutation = useMutation({
|
|
|
|
mutationKey: ['request-password-reset'],
|
|
|
|
mutationFn: authApi.requestPasswordReset
|
|
|
|
});
|
|
|
|
return {
|
2025-02-11 20:15:34 +03:00
|
|
|
requestPasswordReset: (data: IRequestPasswordDTO) => mutation.mutateAsync(data),
|
2025-01-21 20:33:05 +03:00
|
|
|
isPending: mutation.isPending,
|
|
|
|
error: mutation.error,
|
|
|
|
reset: mutation.reset
|
|
|
|
};
|
|
|
|
};
|