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

View File

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

1
index.d.ts vendored
View File

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