mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 12:07:07 +03:00
remove unnecessary async await
This commit is contained in:
@@ -32,9 +32,9 @@ describe("postSkipSegments", () => {
|
|||||||
const warnVideoID = "dQw4w9WgXcF";
|
const warnVideoID = "dQw4w9WgXcF";
|
||||||
const badInputVideoID = "dQw4w9WgXcQ";
|
const badInputVideoID = "dQw4w9WgXcQ";
|
||||||
|
|
||||||
const queryDatabase = async (videoID: string) => await db.prepare("get", `SELECT "startTime", "endTime", "locked", "category" FROM "sponsorTimes" WHERE "videoID" = ?`, [videoID]);
|
const queryDatabase = (videoID: string) => db.prepare("get", `SELECT "startTime", "endTime", "locked", "category" FROM "sponsorTimes" WHERE "videoID" = ?`, [videoID]);
|
||||||
const queryDatabaseActionType = async(videoID: string) => await db.prepare("get", `SELECT "startTime", "endTime", "locked", "category", "actionType" FROM "sponsorTimes" WHERE "videoID" = ?`, [videoID]);
|
const queryDatabaseActionType = (videoID: string) => db.prepare("get", `SELECT "startTime", "endTime", "locked", "category", "actionType" FROM "sponsorTimes" WHERE "videoID" = ?`, [videoID]);
|
||||||
const queryDatabaseDuration = async (videoID: string) => await db.prepare("get", `SELECT "startTime", "endTime", "locked", "category", "videoDuration" FROM "sponsorTimes" WHERE "videoID" = ?`, [videoID]);
|
const queryDatabaseDuration = (videoID: string) => db.prepare("get", `SELECT "startTime", "endTime", "locked", "category", "videoDuration" FROM "sponsorTimes" WHERE "videoID" = ?`, [videoID]);
|
||||||
|
|
||||||
const endpoint = `${getbaseURL()}/api/skipSegments`;
|
const endpoint = `${getbaseURL()}/api/skipSegments`;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import assert from "assert";
|
|||||||
describe("postWarning", () => {
|
describe("postWarning", () => {
|
||||||
// constants
|
// constants
|
||||||
const endpoint = `${getbaseURL()}/api/warnUser`;
|
const endpoint = `${getbaseURL()}/api/warnUser`;
|
||||||
const getWarning = async (userID: string) => await db.prepare("get", `SELECT "userID", "issueTime", "issuerUserID", enabled, "reason" FROM warnings WHERE "userID" = ?`, [userID]);
|
const getWarning = (userID: string) => db.prepare("get", `SELECT "userID", "issueTime", "issuerUserID", enabled, "reason" FROM warnings WHERE "userID" = ?`, [userID]);
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await db.prepare("run", `INSERT INTO "vipUsers" ("userID") VALUES (?)`, [getHash("warning-vip")]);
|
await db.prepare("run", `INSERT INTO "vipUsers" ("userID") VALUES (?)`, [getHash("warning-vip")]);
|
||||||
|
|||||||
Reference in New Issue
Block a user