From 3d7cb08114196d345d6018eab680884c409c5539 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Mon, 15 Apr 2024 17:20:18 -0400 Subject: [PATCH] Fix game ban modal --- components/NewGameBan.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/components/NewGameBan.tsx b/components/NewGameBan.tsx index 89992b2..cb06429 100644 --- a/components/NewGameBan.tsx +++ b/components/NewGameBan.tsx @@ -91,13 +91,16 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { } const [evidence] = files; + const fileList: { name: string; size: number }[] = []; + + for (const file of files) { + fileList.push({ name: file.name, size: file.size }); + } const submitReq = await fetch("/api/reports/submit", { body: JSON.stringify({ actions, - bypass: true, - filename: evidence.name, - filesize: evidence.size, + files: fileList, usernames, }), headers: { @@ -158,6 +161,14 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { method: "POST", }); + await fetch(`/api/reports/${id}/action`, { + body: JSON.stringify(actionMap), + headers: { + "content-type": "application/json", + }, + method: "POST", + }); + toast({ description: "User moderated", status: "success", @@ -225,7 +236,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { (actionMap[user] = parseInt(val))} > - + Do Nothing Hide from Leaderboards Ban