From 3310a82c2906edbf06bc10be6dc132efd672a25e Mon Sep 17 00:00:00 2001 From: bytedream Date: Fri, 29 Dec 2023 00:46:38 +0100 Subject: [PATCH] fix report status not updating when no strike reason is set --- src/routes/admin/reports/+server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/admin/reports/+server.ts b/src/routes/admin/reports/+server.ts index 463b568..6a5bb47 100644 --- a/src/routes/admin/reports/+server.ts +++ b/src/routes/admin/reports/+server.ts @@ -144,7 +144,7 @@ export const PATCH = (async ({ request, cookies }) => { } else if (data.strike_reason == -1 && report.strike_reason_id != null) { report.strike_reason_id = null; report.striked_at = null; - } else if (data.strike_reason != report.strike_reason_id) { + } else if (data.strike_reason != -1 && data.strike_reason != report.strike_reason_id) { if (!report.reported_id) return new Response(null, { status: 400 }); const strike_reason = await StrikeReason.findByPk(data.strike_reason); if (strike_reason == null) return new Response(null, { status: 400 });