27 lines
663 B
TypeScript
27 lines
663 B
TypeScript
export async function onRequestPost(context: RequestContext) {
|
|
const appealId = context.params.id as string;
|
|
|
|
const appeal = await context.env.DATA.get(`gameappeal_${appealId}`);
|
|
|
|
if (!appeal)
|
|
return new Response('{"error":"Appeal not found"}', {
|
|
headers: {
|
|
"content-type": "application/json",
|
|
},
|
|
status: 404,
|
|
});
|
|
|
|
const appealData = JSON.parse(appeal);
|
|
|
|
await context.env.DATA.delete(`gameappeal_${appealId}`);
|
|
await context.env.DATA.put(
|
|
`gameappealblock_${appealData.roblox_id}`,
|
|
`${Date.now() + 2592000000}`,
|
|
{ expirationTtl: 2592000000 },
|
|
);
|
|
|
|
return new Response(null, {
|
|
status: 204,
|
|
});
|
|
}
|