Fix userCount using lower case

This commit is contained in:
Ajay Ramachandran 2021-08-10 10:58:20 -04:00
parent fa901add35
commit 0fded0022c

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);
}