Merge pull request #320 from HaiDang666/refactor-postSkipSegments

Split code in postSkipSegment
This commit is contained in:
Ajay Ramachandran
2021-07-26 23:49:08 -04:00
committed by GitHub
2 changed files with 241 additions and 146 deletions

View File

@@ -2,5 +2,5 @@ import {db} from "../databases/databases";
import { HashedUserID } from "../types/user.model";
export async function isUserVIP(userID: HashedUserID): Promise<boolean> {
return (await db.prepare("get", `SELECT count(*) as "userCount" FROM "vipUsers" WHERE "userID" = ?`, [userID])).userCount > 0;
return (await db.prepare("get", `SELECT count(*) as "userCount" FROM "vipUsers" WHERE "userID" = ? LIMIT 1`, [userID])).userCount > 0;
}