diff --git a/src/services/user.js b/src/services/user.js index 10997b5..5b16367 100644 --- a/src/services/user.js +++ b/src/services/user.js @@ -6,7 +6,6 @@ import errorHandler from '../utils/pgerrorhandler.js'; class UserService { async create(username, password) { - if (await this.getByUsername(username)) throw new customError(`Such user exists`, responseCodes.responses.user.duplicate); await db.query("INSERT INTO users (username, password) VALUES ($1, $2)", [username, bcrypt.hashSync(password, 12)]).catch((e) => { errorHandler(e, "user"); })