fix: item error message.

This commit is contained in:
elforjani3
2021-01-02 15:19:56 +02:00
parent a1c228a8a4
commit 9014e1229f
2 changed files with 16 additions and 6 deletions

View File

@@ -163,11 +163,10 @@ function ItemForm({
history.push('/items');
}
};
const onError = ({ response }) => {
const onError = (errors) => {
setSubmitting(false);
if (response.data.errors) {
const _errors = transformApiErrors(response.data.errors);
if (errors) {
const _errors = transformApiErrors(errors);
setErrors({ ..._errors });
}
};