fix: add calloutCodes.

This commit is contained in:
elforjani13
2021-11-11 11:19:58 +02:00
parent 22069f4795
commit ce9169b24d
3 changed files with 12 additions and 3 deletions

View File

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