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

@@ -34,7 +34,7 @@ const NavyFormComponent = () => {
setProvinceList(formattedData);
})
.catch((error) => {
Notifications(directionApp, t, error.response);
Notifications(t, error.response);
});
}, []);
// end get province list
@@ -115,7 +115,7 @@ const NavyFormComponent = () => {
// submit
const handleSubmit = async (values, props) => {
Notifications(directionApp, t, undefined);
Notifications(t, undefined);
const formData = new FormData();
formData.append("name", values.name);
formData.append("phone_number", values.phone_number);
@@ -138,10 +138,10 @@ const NavyFormComponent = () => {
},
})
.then(function (response) {
Notifications(directionApp, t, response);
Notifications(t, response);
})
.catch(function (error) {
Notifications(directionApp, t, error.response);
Notifications(t, error.response);
props.setSubmitting(false);
});
};

View File

@@ -87,7 +87,7 @@ const WelfareServicesFormComponent = () => {
});
const handleSubmit = async (values, props) => {
Notifications(directionApp, t, undefined);
Notifications(t, undefined);
const formData = new FormData();
formData.append("name", values.name);
formData.append("phone_number", values.phone_number);
@@ -109,10 +109,10 @@ const WelfareServicesFormComponent = () => {
},
})
.then(function (response) {
Notifications(directionApp, t, response);
Notifications(t, response);
})
.catch(function (error) {
Notifications(directionApp, t, error.response);
Notifications(t, error.response);
props.setSubmitting(false);
});
};