Switch to case sensitive and get submitting + getting working

This commit is contained in:
Ajay Ramachandran
2021-03-04 20:23:05 -05:00
parent 1a66be8665
commit 2772a9dcc6
16 changed files with 87 additions and 87 deletions

View File

@@ -27,14 +27,14 @@ export async function addUserAsVIP(req: Request, res: Response) {
}
//check to see if this user is already a vip
const row = await db.prepare('get', "SELECT count(*) as userCount FROM vipUsers WHERE userID = ?", [userID]);
const row = await db.prepare('get', 'SELECT count(*) as "userCount" FROM vipUsers WHERE userID = ?', [userID]);
if (enabled && row.userCount == 0) {
//add them to the vip list
await db.prepare('run', "INSERT INTO vipUsers VALUES(?)", [userID]);
await db.prepare('run', 'INSERT INTO "vipUsers" VALUES(?)', [userID]);
} else if (!enabled && row.userCount > 0) {
//remove them from the shadow ban list
await db.prepare('run', "DELETE FROM vipUsers WHERE userID = ?", [userID]);
await db.prepare('run', 'DELETE FROM "vipUsers" WHERE "userID" = ?', [userID]);
}
res.sendStatus(200);