Split code in postSkipSegment

This commit is contained in:
Haidang666
2021-07-22 14:02:33 +07:00
parent ef71405143
commit 22debb4374
2 changed files with 242 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;
}