Skip to content

Commit

Permalink
feat(reg, user): changed phone number format submitted to server (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeffer authored Nov 11, 2023
1 parent a5c6819 commit 226e0d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/Profile/ProfileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export const ProfileForm: FC = () => {
first_name: data.first_name,
last_name: data.last_name,
school: data.school?.id,
phone: data.phone,
parent_phone: data.parent_phone,
phone: data.phone?.replaceAll(/\s+/gu, ''),
parent_phone: data.parent_phone?.replaceAll(/\s+/gu, ''),
grade: data.grade,
},
new_school_description: data.new_school_description || '',
Expand All @@ -100,7 +100,7 @@ export const ProfileForm: FC = () => {
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.'
return '* Zadaj telefónne číslo vo formáte +421 123 456 789 alebo +421123456789.'
},
}
return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/RegisterForm/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export const RegisterForm: FC = () => {
first_name: data.first_name,
last_name: data.last_name,
school: data.school?.id,
phone: data.phone,
parent_phone: data.parent_phone,
phone: data.phone?.replaceAll(/\s+/gu, ''),
parent_phone: data.parent_phone?.replaceAll(/\s+/gu, ''),
gdpr: data.gdpr,
grade: data.grade,
},
Expand Down Expand Up @@ -101,7 +101,7 @@ export const RegisterForm: FC = () => {
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.'
return '* Zadaj telefónne číslo vo formáte +421 123 456 789 alebo +421123456789.'
},
}
return (
Expand Down

0 comments on commit 226e0d0

Please sign in to comment.