diff --git a/routes/api/account/index.js b/routes/api/account/index.js index 68befd665..4eab8b920 100644 --- a/routes/api/account/index.js +++ b/routes/api/account/index.js @@ -123,7 +123,7 @@ router.put('/username', authorization.needed(), (req, res, next) => { }) .catch(error => { if (error.code === 11000) { - next(errors.ErrUsernameTake); + next(errors.ErrUsernameTaken); } else { next(error); } diff --git a/services/users.js b/services/users.js index df9536525..b09a7d399 100644 --- a/services/users.js +++ b/services/users.js @@ -257,7 +257,7 @@ module.exports = class UsersService { if (err) { if (err.code === 11000) { if (err.message.match('Username')) { - return reject(errors.ErrUsernameTake); + return reject(errors.ErrUsernameTaken); } return reject(errors.ErrEmailTaken); }