BIG-81: handle error message.

This commit is contained in:
elforjani3
2021-09-14 16:50:22 +02:00
parent 9123662a87
commit af492310e8
5 changed files with 14 additions and 4 deletions

View File

@@ -78,6 +78,13 @@ function EstimateForm({
estimate_number: intl.get('estimate_number_is_not_unqiue'),
});
}
if (
errors.some((error) => error.type === ERROR.SALE_ESTIMATE_NO_IS_REQUIRED)
) {
setErrors({
estimate_number: intl.get('estimate.field.error.estimate_number'),
});
}
};
// Handles form submit.

View File

@@ -153,6 +153,7 @@ function InvoiceFormHeaderFields({
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'invoice_no'} />}
labelInfo={<FieldRequiredHint />}
inline={true}
className={classNames('form-group--invoice-no', CLASSES.FILL)}
intent={inputIntent({ error, touched })}

View File

@@ -93,8 +93,7 @@ export const transformErrors = (errors, { setErrors }) => {
errors.some((error) => error.type === ERROR.SALE_INVOICE_NO_IS_REQUIRED)
) {
setErrors({
invoice_no:
'Invoice number is required, use auto-increment mode or enter manually.',
invoice_no: intl.get('invoice.field.error.invoice_no'),
});
}
};