refactor: use non-asyc version of mutate

This commit is contained in:
kasia.oczkowska
2024-11-21 14:34:11 +00:00
parent 90a7b4c1c0
commit 551548400f

View File

@@ -12,20 +12,17 @@ import useFormatMessage from 'hooks/useFormatMessage';
export default function ForgotPasswordForm() { export default function ForgotPasswordForm() {
const formatMessage = useFormatMessage(); const formatMessage = useFormatMessage();
const { const {
mutateAsync: forgotPassword, mutate: forgotPassword,
isPending: loading, isPending: loading,
isSuccess, isSuccess,
isError, isError,
error, error,
} = useForgotPassword(); } = useForgotPassword();
const handleSubmit = async (values) => { const handleSubmit = ({ email }) => {
const { email } = values; forgotPassword({
try { email,
await forgotPassword({ });
email,
});
} catch {}
}; };
return ( return (