fix: handle error.

This commit is contained in:
elforjani13
2021-11-08 14:54:11 +02:00
parent 6d67d6163d
commit adc6b336e0
7 changed files with 30 additions and 7 deletions

View File

@@ -39,11 +39,14 @@ function NotifyEstimateViaSMSForm({
data: { errors },
},
}) => {
transformErrors(errors);
if (errors) {
transformErrors(errors, { setErrors });
}
setSubmitting(false);
};
createNotifyEstimateBySMSMutate([estimateId, values])
.then(onSuccess)
.then(onError);
.catch(onError);
};
return (

View File

@@ -42,7 +42,10 @@ function NotifyInvoiceViaSMSForm({
data: { errors },
},
}) => {
transformErrors(errors);
if (errors) {
transformErrors(errors, { setErrors });
}
setSubmitting(false);
};
createNotifyInvoiceBySMSMutate([invoiceId, values])
.then(onSuccess)

View File

@@ -44,7 +44,10 @@ function NotifyPaymentReceiveViaSMSForm({
data: { errors },
},
}) => {
transformErrors(errors);
if (errors) {
transformErrors(errors, { setErrors });
}
setSubmitting(false);
};
createNotifyPaymentReceivetBySMSMutate([paymentReceiveId, values])
.then(onSuccess)

View File

@@ -42,7 +42,10 @@ function NotifyReceiptViaSMSForm({
data: { errors },
},
}) => {
transformErrors(errors);
if (errors) {
transformErrors(errors, { setErrors });
}
setSubmitting(false);
};
createNotifyReceiptBySMSMutate([receiptId, values])
.then(onSuccess)