Fix type check for warning duplicate

This commit is contained in:
Ajay 2023-07-17 23:38:52 -04:00
parent a5501b9655
commit 85fc0477ad

View file

@ -43,7 +43,7 @@ export async function postWarning(req: Request, res: Response): Promise<Response
let resultStatus = "";
if (enabled) {
const previousWarning = await db.prepare("get", 'SELECT * FROM "warnings" WHERE "userID" = ? AND "issuerUserID" = ?', [userID, issuerUserID]) as warningEntry;
const previousWarning = await db.prepare("get", 'SELECT * FROM "warnings" WHERE "userID" = ? AND "issuerUserID" = ? AND "type" = ?', [userID, issuerUserID, type]) as warningEntry;
if (!previousWarning) {
await db.prepare(