Make game appeal actions ACTUALLY work now

This commit is contained in:
regalijan 2023-10-19 16:51:16 -04:00
parent 733d74824d
commit 8778547286
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520
3 changed files with 13 additions and 8 deletions

View File

@ -29,7 +29,9 @@ export default function (props: GameAppealProps) {
(document.getElementById("reductPercentage") as HTMLInputElement).value,
);
const actionResponse = await fetch(`/api/game-appeals/${props.roblox_id}`, {
const actionResponse = await fetch(
`/api/game-appeals/${props.id}/${action}`,
{
body: JSON.stringify({
statsReduction: isNaN(statsReduction) ? 0 : statsReduction,
}),
@ -37,7 +39,8 @@ export default function (props: GameAppealProps) {
"content-type": "application/json",
},
method: "POST",
});
},
);
useToast()(
actionResponse.ok

View File

@ -50,6 +50,7 @@ export async function onRequestPost(context: RequestContext) {
await context.env.DATA.put(
`gameappeal_${appealId}`,
JSON.stringify({
id: appealId,
reasonForUnban,
roblox_id: id,
roblox_username: username,

1
index.d.ts vendored
View File

@ -36,6 +36,7 @@ declare global {
interface GameAppealProps {
created_at: number;
id: string;
reasonForUnban: string;
roblox_id: number;
roblox_username: string;