-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified mentee registration validations #201
Modified mentee registration validations #201
Conversation
src/schemas.ts
Outdated
contactNo: z | ||
.string() | ||
.min(1, { message: 'Contact number cannot be empty' }) | ||
.regex(/^\+[1-9]\d{1,14}$/, 'Invalid contact number'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Disura-Randunu Did you check this for multiple countries? Each country has different lengths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats why a common length was added. Around 14 digits. Should start with + to indicate the country code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to say that you need to add + then let's remove + validations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/^+[1-9]\d{1,3}\d{6,12}$/
this is a bit more correct than before. can have upto 3 numbers after + which makes the country code. then 6-12 digits which is kind of standard amount of numbers in any country.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anjula-sack updated contactNo validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! @Disura-Randunu
Purpose
The purpose of this PR is to fix #128
Goals
Improve validations on Mentee registration.
Approach
Modified Mentee Application Validation Schema to handle possible invalids for several fields (contact no, graduated year, year of study. cv link)
Screenshots
Checklist
Related PRs
Test environment
Learning