implementation error handler
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user