Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix game ban modal
  • Loading branch information
regalijan committed Apr 15, 2024
1 parent 108d15d commit 3d7cb08
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions components/NewGameBan.tsx
Expand Up @@ -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: {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -225,7 +236,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
<RadioGroup
onChange={(val) => (actionMap[user] = parseInt(val))}
>
<VStack>
<VStack alignItems="flex-start">
<Radio value="0">Do Nothing</Radio>
<Radio value="1">Hide from Leaderboards</Radio>
<Radio value="2">Ban</Radio>
Expand Down

0 comments on commit 3d7cb08

Please sign in to comment.