refactor: use non-asyc version of mutate
This commit is contained in:
@@ -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 {
|
|
||||||
await forgotPassword({
|
|
||||||
email,
|
email,
|
||||||
});
|
});
|
||||||
} catch {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user