mistake
This commit is contained in:
@@ -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");
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user