mistake
This commit is contained in:
parent
9cd1debd4a
commit
d809abd17b
|
@ -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");
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue