Skip to content

Commit

Permalink
add empty string in teamCode validator for creating new user
Browse files Browse the repository at this point in the history
  • Loading branch information
wang9hu committed Nov 5, 2023
1 parent 52be2b9 commit 4e318bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/userProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const userProfileSchema = new Schema({
default: '',
validate: {
validator(v) {
const teamCoderegex = /^([a-zA-Z]-[a-zA-Z]{3}|[a-zA-Z]{5})$/;
const teamCoderegex = /^([a-zA-Z]-[a-zA-Z]{3}|[a-zA-Z]{5})$|^$/;
return teamCoderegex.test(v);
},
message:
Expand Down

0 comments on commit 4e318bc

Please sign in to comment.