Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Close actioned reports
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 31bbdd8 commit d068088
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions functions/api/reports/[id]/action.ts
Expand Up @@ -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,
});
Expand Down

0 comments on commit d068088

Please sign in to comment.