Skip to content

Commit

Permalink
feat(registration, user): fixed phone number validation
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeffer committed Nov 11, 2023
1 parent 33685f8 commit 7a84fb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Profile/ProfileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export const ProfileForm: FC = () => {
const requiredRule = {required: '* Toto pole nemôže byť prázdne.'}
const phoneRule = {
validate: (val?: string) => {
if (val && !/^(\+\d{10,12})$/u.test(val.replaceAll(/\s+/gu, '')))
return '* Zadaj telefónne číslo vo formáte validnom formáte +421 123 456 789 alebo +421123456789.'
if (val && !/^(\+\d{10,12})$/u.test(val))

Check failure on line 102 in src/components/Profile/ProfileForm.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Delete `⏎·······`
return '* Zadaj telefónne číslo vo formáte +421123456789.'
},
}
return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/RegisterForm/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export const RegisterForm: FC = () => {
const requiredRule = {required: '* Toto pole nemôže byť prázdne.'}
const phoneRule = {
validate: (val?: string) => {
if (val && !/^(\+\d{10,12})$/u.test(val.replaceAll(/\s+/gu, '')))
return '* Zadaj telefónne číslo vo formáte validnom formáte +421 123 456 789 alebo +421123456789.'
if (val && !/^(\+\d{10,12})$/u.test(val))

Check failure on line 90 in src/components/RegisterForm/RegisterForm.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Delete `⏎·······`
return '* Zadaj telefónne číslo vo formáte +421123456789.'
},
}
return (
Expand Down

0 comments on commit 7a84fb4

Please sign in to comment.