Fix game ban modal

This commit is contained in:
Regalijan 2024-04-15 17:20:18 -04:00
parent 108d15d1fe
commit 3d7cb08114
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -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 }) {
<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>