From 7357ad9e88fff32a69180e9c435427643d90c346 Mon Sep 17 00:00:00 2001 From: bytedream Date: Fri, 20 Dec 2024 21:07:36 +0100 Subject: [PATCH] actually fix strike date not set if status changed but strike reason not --- src/routes/admin/reports/+server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/admin/reports/+server.ts b/src/routes/admin/reports/+server.ts index c042e20..b9bb58d 100644 --- a/src/routes/admin/reports/+server.ts +++ b/src/routes/admin/reports/+server.ts @@ -119,9 +119,6 @@ export const PATCH = (async ({ request, cookies }) => { } report.reported_id = reported?.id ?? null; - if (data.notice != null) report.notice = data.notice; - if (data.statement != null) report.statement = data.statement; - if (data.status != null) report.status = data.status; if (data.strike_reason != null) { if (data.status !== 'reviewed') { if (data.strike_reason == -1) { @@ -145,6 +142,9 @@ export const PATCH = (async ({ request, cookies }) => { report.striked_at = new Date(Date.now()); } } + if (data.notice != null) report.notice = data.notice; + if (data.statement != null) report.statement = data.statement; + if (data.status != null) report.status = data.status; if (admin != null) report.auditor_id = admin.id; await report.save();