Chore: Add validation for contact phone field (#2105)
This commit is contained in:
committed by
GitHub
parent
ce4ce3c86c
commit
98bfef026e
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 === '';
|
||||
Reference in New Issue
Block a user