Merge branch 'develop' of https://github.com/bigcapitalhq/client into develop

This commit is contained in:
a.bouhuolia
2021-11-11 11:27:06 +02:00
3 changed files with 12 additions and 3 deletions

View File

@@ -27,6 +27,8 @@ function NotifyEstimateViaSMSForm({
createNotifyEstimateBySMSMutate, createNotifyEstimateBySMSMutate,
} = useEstimateViaSMSContext(); } = useEstimateViaSMSContext();
const [calloutCode, setCalloutCode] = React.useState([]);
// Handles the form submit. // Handles the form submit.
const handleFormSubmit = (values, { setSubmitting, setErrors }) => { const handleFormSubmit = (values, { setSubmitting, setErrors }) => {
setSubmitting(true); setSubmitting(true);
@@ -47,7 +49,7 @@ function NotifyEstimateViaSMSForm({
}, },
}) => { }) => {
if (errors) { if (errors) {
transformErrors(errors, { setErrors }); transformErrors(errors, { setErrors, setCalloutCode });
} }
setSubmitting(false); setSubmitting(false);
}; };
@@ -70,6 +72,7 @@ function NotifyEstimateViaSMSForm({
notificationTypes={notificationType} notificationTypes={notificationType}
onCancel={handleFormCancel} onCancel={handleFormCancel}
onSubmit={handleFormSubmit} onSubmit={handleFormSubmit}
calloutCodes={calloutCode}
/> />
); );
} }

View File

@@ -30,6 +30,8 @@ function NotifyPaymentReceiveViaSMSForm({
createNotifyPaymentReceivetBySMSMutate, createNotifyPaymentReceivetBySMSMutate,
} = useNotifyPaymentReceiveViaSMSContext(); } = useNotifyPaymentReceiveViaSMSContext();
const [calloutCode, setCalloutCode] = React.useState([]);
// Handles the form submit. // Handles the form submit.
const handleFormSubmit = (values, { setSubmitting, setErrors }) => { const handleFormSubmit = (values, { setSubmitting, setErrors }) => {
// Handle request response success. // Handle request response success.
@@ -50,7 +52,7 @@ function NotifyPaymentReceiveViaSMSForm({
}, },
}) => { }) => {
if (errors) { if (errors) {
transformErrors(errors, { setErrors }); transformErrors(errors, { setErrors, setCalloutCode });
} }
setSubmitting(false); setSubmitting(false);
}; };
@@ -75,6 +77,7 @@ function NotifyPaymentReceiveViaSMSForm({
notificationTypes={notificationType} notificationTypes={notificationType}
onSubmit={handleFormSubmit} onSubmit={handleFormSubmit}
onCancel={handleFormCancel} onCancel={handleFormCancel}
calloutCodes={calloutCode}
/> />
); );
} }

View File

@@ -30,6 +30,8 @@ function NotifyReceiptViaSMSForm({
createNotifyReceiptBySMSMutate, createNotifyReceiptBySMSMutate,
} = useNotifyReceiptViaSMSContext(); } = useNotifyReceiptViaSMSContext();
const [calloutCode, setCalloutCode] = React.useState([]);
// Handles the form submit. // Handles the form submit.
const handleFormSubmit = (values, { setSubmitting, setErrors }) => { const handleFormSubmit = (values, { setSubmitting, setErrors }) => {
// Handle request response success. // Handle request response success.
@@ -48,7 +50,7 @@ function NotifyReceiptViaSMSForm({
}, },
}) => { }) => {
if (errors) { if (errors) {
transformErrors(errors, { setErrors }); transformErrors(errors, { setErrors, setCalloutCode });
} }
setSubmitting(false); setSubmitting(false);
}; };
@@ -74,6 +76,7 @@ function NotifyReceiptViaSMSForm({
notificationTypes={notificationType} notificationTypes={notificationType}
onSubmit={handleFormSubmit} onSubmit={handleFormSubmit}
onCancel={handleFormCancel} onCancel={handleFormCancel}
calloutCodes={calloutCode}
/> />
); );
} }