Files
car-crushers-portal/functions/api/game-appeals/[id]/deny.ts
Regalijan 5c17f87f89
All checks were successful
Test, Build, Deploy / Test, Build, and Deploy (push) Successful in 58s
Test, Build, Deploy / Create Sentry Release (push) Successful in 6s
Migrate the rest of the easy stuff
2026-04-11 04:32:09 -04:00

32 lines
672 B
TypeScript

import { jsonError } from "../../../common.js";
export async function onRequestPost(context: RequestContext) {
const appealId = context.params.id as string;
const appeal = await context.data.prisma.gameAppeal.findUnique({
select: {
roblox_id: true,
},
where: {
id: appealId,
},
});
if (!appeal) return jsonError("Appeal not found", 404);
await context.data.prisma.gameAppeal.delete({
where: {
id: appealId,
},
});
await context.env.DATA.put(
`gameappealblock_${appeal.roblox_id}`,
`${Date.now() + 2592000000}`,
{ expirationTtl: 2592000 },
);
return new Response(null, {
status: 204,
});
}