mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
feat: handle error.
This commit is contained in:
@@ -4,7 +4,7 @@ import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||
|
||||
const Schema = Yup.object().shape({
|
||||
customer_name: Yup.string().required(),
|
||||
customer_phone_number: Yup.number().required(),
|
||||
customer_phone_number: Yup.number(),
|
||||
sms_message: Yup.string().required().trim().max(DATATYPES_LENGTH.TEXT),
|
||||
});
|
||||
|
||||
|
||||
12
src/containers/NotifyViaSMS/utils.js
Normal file
12
src/containers/NotifyViaSMS/utils.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { AppToaster } from 'components';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const transformErrors = (errors) => {
|
||||
if (errors.some((e) => e.type === 'CUSTOMER_SMS_NOTIFY_PHONE_INVALID')) {
|
||||
AppToaster.show({
|
||||
message: intl.get('notify_via_sms.dialog.error_message'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user