implementation error handler

This commit is contained in:
Amirhossein Mahmoodi
2023-08-09 13:41:14 +03:30
parent 929a7741a6
commit b17bc0136c
22 changed files with 214 additions and 48 deletions

View File

@@ -37,19 +37,19 @@ const RequestOtpComponent = ({
});
const handleSubmit = async (values, props) => {
Notifications(directionApp, t, undefined);
Notifications(t, undefined);
await axios
.post(SEND_OTP_TOKEN, {
phone_number: values.phone_number,
})
.then(function (response) {
Notifications(directionApp, t, response);
Notifications(t, response);
setPhoneNumber(values.phone_number);
setOtpToken(true);
setTimer(initialTimerValue);
})
.catch(function (error) {
Notifications(directionApp, t, error.response);
Notifications(t, error.response);
props.setSubmitting(false);
});
};