fix email
This commit is contained in:
parent
d41551c806
commit
bac5347c65
3 changed files with 12 additions and 10 deletions
|
|
@ -29,10 +29,7 @@ class AllowedString extends mongoose.SchemaType {
|
|||
const email = {
|
||||
type: String,
|
||||
validate: {
|
||||
validator: function(v: string) {
|
||||
console.log(v)
|
||||
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
|
||||
},
|
||||
validator: (v: string) => /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v),
|
||||
message: "Invalid email"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue