From d0680884d8e77962274419fdb9aaa79c14309461 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:55 -0400 Subject: [PATCH] Close actioned reports --- functions/api/reports/[id]/action.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/functions/api/reports/[id]/action.ts b/functions/api/reports/[id]/action.ts index ad96ea7..8f5d21a 100644 --- a/functions/api/reports/[id]/action.ts +++ b/functions/api/reports/[id]/action.ts @@ -72,6 +72,12 @@ export async function onRequestPost(context: RequestContext) { Object.assign(banList, newActions); await setBanList(context, banList); + reportData.open = false; + await context.env.DATA.put(`report_${reportId}`, JSON.stringify(reportData)); + await context.env.D1.prepare("UPDATE reports SET open = 0 WHERE id = ?;") + .bind(reportId) + .run(); + return new Response(null, { status: 204, });