Skip to content

Commit d8ba66f

Browse files
Joshua Zhoujoshuazhou744
authored andcommitted
Add validation for empty phone numbers
1 parent 128c1b7 commit d8ba66f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/features/Account/validationSchema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const getValidationSchema = (isCreate: boolean) => {
2222
'validPhone',
2323
'Must be a valid phone number',
2424
(value) => {
25+
if (!value) return false;
2526
const parsedValue = value?.replace(/\D/g, '');
2627
return (
2728
!parsedValue || (parsedValue.length > 10 && parsedValue.length < 14)

0 commit comments

Comments
 (0)