Chore: Add validation for contact phone field (#2105)
This commit is contained in:
parent
ce4ce3c86c
commit
98bfef026e
3 changed files with 31 additions and 8 deletions
2
app/javascript/shared/helpers/Validators.js
Normal file
2
app/javascript/shared/helpers/Validators.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const isPhoneE164 = value => !!value.match(/^\+[1-9]\d{1,14}$/);
|
||||
export const isPhoneE164OrEmpty = value => isPhoneE164(value) || value === '';
|
Loading…
Add table
Add a link
Reference in a new issue