Check against number for username lock

This commit is contained in:
Ajay Ramachandran 2021-08-10 00:37:43 -04:00
parent e417dade68
commit f3e5b360c4

View file

@ -46,7 +46,7 @@ export async function setUsername(req: Request, res: Response): Promise<Response
}
try {
const row = await db.prepare("get", `SELECT count(*) as userCount FROM "userNames" WHERE "userID" = ? AND "locked" = '1'`, [userID]);
const row = await db.prepare("get", `SELECT count(*) as userCount FROM "userNames" WHERE "userID" = ? AND "locked" = 1`, [userID]);
if (adminUserIDInput === undefined && row.userCount > 0) {
return res.sendStatus(200);
}