feat: add notify by sms .

This commit is contained in:
elforjani13
2021-11-07 20:11:15 +02:00
parent 7706d2992c
commit 4d89f1e0e0
17 changed files with 141 additions and 75 deletions

View File

@@ -11,7 +11,7 @@ import { transformToForm, saveInvoke } from 'utils';
const defaultInitialValues = {
customer_name: '',
customer_personal_phone: '',
customer_phone_number: '',
sms_message: '',
};

View File

@@ -4,7 +4,7 @@ import { DATATYPES_LENGTH } from 'common/dataTypes';
const Schema = Yup.object().shape({
customer_name: Yup.string().required(),
customer_personal_phone: Yup.number().required(),
customer_phone_number: Yup.number().required(),
sms_message: Yup.string().required().trim().max(DATATYPES_LENGTH.TEXT),
});

View File

@@ -31,15 +31,15 @@ function NotifyViaSMSFormFields() {
</FastField>
{/* ----------- Phone number ----------- */}
<FastField name={'customer_personal_phone'}>
<FastField name={'customer_phone_number'}>
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'phone_number'} />}
labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name="customer_personal_phone" />}
helperText={<ErrorMessage name="customer_phone_number" />}
className={classNames(
'form-group--customer_personal_phone',
'form-group--customer_phone_number',
CLASSES.FILL,
)}
>