Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make game appeal actions ACTUALLY work now
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 733d748 commit 8778547
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
19 changes: 11 additions & 8 deletions components/GameAppealCard.tsx
Expand Up @@ -29,15 +29,18 @@ export default function (props: GameAppealProps) {
(document.getElementById("reductPercentage") as HTMLInputElement).value,
);

const actionResponse = await fetch(`/api/game-appeals/${props.roblox_id}`, {
body: JSON.stringify({
statsReduction: isNaN(statsReduction) ? 0 : statsReduction,
}),
headers: {
"content-type": "application/json",
const actionResponse = await fetch(
`/api/game-appeals/${props.id}/${action}`,
{
body: JSON.stringify({
statsReduction: isNaN(statsReduction) ? 0 : statsReduction,
}),
headers: {
"content-type": "application/json",
},
method: "POST",
},
method: "POST",
});
);

useToast()(
actionResponse.ok
Expand Down
1 change: 1 addition & 0 deletions functions/api/game-appeals/submit.ts
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Expand Up @@ -36,6 +36,7 @@ declare global {

interface GameAppealProps {
created_at: number;
id: string;
reasonForUnban: string;
roblox_id: number;
roblox_username: string;
Expand Down

0 comments on commit 8778547

Please sign in to comment.