fix non-format eslint in src/

This commit is contained in:
Michael C
2021-07-12 02:12:22 -04:00
parent 9445a06871
commit c0b1d201ad
66 changed files with 829 additions and 834 deletions

View File

@@ -1,7 +1,7 @@
import {getHash} from '../utils/getHash';
import {db} from '../databases/databases';
import {config} from '../config';
import {Request, Response} from 'express';
import {getHash} from "../utils/getHash";
import {db} from "../databases/databases";
import {config} from "../config";
import {Request, Response} from "express";
export async function addUserAsVIP(req: Request, res: Response): Promise<Response> {
const userID = req.query.userID as string;
@@ -9,7 +9,7 @@ export async function addUserAsVIP(req: Request, res: Response): Promise<Respons
const enabled = req.query.enabled === undefined
? false
: req.query.enabled === 'true';
: req.query.enabled === "true";
if (userID == undefined || adminUserIDInput == undefined) {
//invalid request
@@ -25,14 +25,14 @@ export async function addUserAsVIP(req: Request, res: Response): Promise<Respons
}
//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]);
}
return res.sendStatus(200);