Skip to content
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

fix: gender issue #288

Merged
merged 5 commits into from
Oct 24, 2024
Merged

fix: gender issue #288

merged 5 commits into from
Oct 24, 2024

Conversation

kkyusuftk
Copy link
Collaborator

@kkyusuftk kkyusuftk commented Oct 24, 2024

The gender value supported by our backend are
"male", "female", "unknown", "others", "m", "f", "u","o"

Comment on lines +1951 to 1952
if (profileKey === 'Gender' && !profileVal.match(/\b(?:[mM](?:ale)?|[fF](?:emale)?|[oO](?:thers)?|[uU](?:nknown)?)\b/)) {
valid = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better if we make the check more readable instead of using regex here? Just a suggestion.

Something like

const validGenders = ['male', 'female', 'others', 'unknown', 'm', 'f']; // can be in a constants 
const isMatch = validGenders.includes(profileVal.toLowerCase());

@kkyusuftk kkyusuftk merged commit e45dbfd into develop Oct 24, 2024
2 checks passed
@kkyusuftk kkyusuftk deleted the fix-gender-issue branch October 24, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants