From b5b60d6f286abe52bd4cc49ebaf6d417fdb05625 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Sun, 9 May 2021 00:50:19 +0200 Subject: [PATCH] fix: catch error bill. --- client/src/containers/Purchases/Bills/BillForm/BillForm.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/containers/Purchases/Bills/BillForm/BillForm.js b/client/src/containers/Purchases/Bills/BillForm/BillForm.js index 1cdf766d2..12fc015ca 100644 --- a/client/src/containers/Purchases/Bills/BillForm/BillForm.js +++ b/client/src/containers/Purchases/Bills/BillForm/BillForm.js @@ -114,7 +114,11 @@ function BillForm({ } }; // Handle the request error. - const onError = (errors) => { + const onError = ({ + response: { + data: { errors }, + }, + }) => { handleErrors(errors, { setErrors }); setSubmitting(false); };