Skip to content

Commit

Permalink
email validation on the model
Browse files Browse the repository at this point in the history
  • Loading branch information
holabayor committed Sep 23, 2023
1 parent 2bdd6ab commit 7d78d36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/organisation_invite.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const orgInvites = sequelize.define(
email: {
type: DataTypes.STRING,
allowNull: false,
validate: {
isEmail: { msg: 'Invalid email' },
},
},
token: {
type: DataTypes.STRING,
Expand Down
3 changes: 3 additions & 0 deletions models/user.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const User = sequelize.define(
type: DataTypes.STRING,
unique: true,
allowNull: false,
validate: {
isEmail: { msg: 'Invalid email' },
},
},
password_hash: {
type: DataTypes.STRING,
Expand Down

0 comments on commit 7d78d36

Please sign in to comment.