Skip to content

Commit a7d284c

Browse files
author
Joshua Zhou
committed
check for empty parsed
1 parent 49c943a commit a7d284c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/features/Account/validationSchema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const getValidationSchema = (isCreate: boolean) => {
2424
(value) => {
2525
if (!value) return false;
2626
const parsedValue = value?.replace(/\D/g, '');
27-
return !parsedValue || (parsedValue.length > 10 && parsedValue.length < 14);
27+
if (!parsedValue) return false;
28+
return (parsedValue.length > 10 && parsedValue.length < 14);
2829
}
2930
),
3031
age: number()

0 commit comments

Comments
 (0)