From 1678dcac8229969d9f522bc3bf4c6eaa9a06f4d8 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 3 Aug 2021 13:24:23 -0400 Subject: [PATCH] Get all warnings --- src/routes/postSkipSegments.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index 820ef54..1db9d4e 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -288,12 +288,10 @@ async function checkUserActiveWarning(userID: string): Promise { `SELECT "reason" FROM warnings WHERE "userID" = ? AND "issueTime" > ? AND enabled = 1 - ORDER BY "issueTime" DESC - LIMIT ?`, + ORDER BY "issueTime" DESC`, [ userID, - Math.floor(now - (config.hoursAfterWarningExpires * MILLISECONDS_IN_HOUR)), - config.maxNumberOfActiveWarnings + Math.floor(now - (config.hoursAfterWarningExpires * MILLISECONDS_IN_HOUR)) ], ) as {reason: string}[]).sort((a, b) => (b?.reason?.length ?? 0) - (a?.reason?.length ?? 0));