Skip to content

Commit

Permalink
fix(users): allow apostrophes in the name
Browse files Browse the repository at this point in the history
  • Loading branch information
serge1peshcoff committed Feb 6, 2020
1 parent da1fbd4 commit 34f0d30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const User = sequelize.define('user', {
validate: {
notEmpty: { msg: 'Last name should be set.' },
isValid(value) {
if (!new RegExp('^[\\p{L} -]*$', 'u').test(value)) {
if (!new RegExp('^[\\p{L} -\']*$', 'u').test(value)) {
throw new Error('Last name should only contain letters, spaces and dashes.');
}
}
Expand Down

0 comments on commit 34f0d30

Please sign in to comment.