Skip to content
Permalink
Newer
Older
100644 27 lines (21 sloc) 660 Bytes
October 19, 2023 16:50
1
import { jsonError } from "../../../common.js";
2
October 19, 2023 16:49
3
export async function onRequestPost(context: RequestContext) {
4
const appealId = context.params.id as string;
5
6
const appeal = await context.env.D1.prepare(
7
"SELECT * FROM game_appeals WHERE id = ?;",
8
)
9
.bind(appealId)
10
.first();
October 19, 2023 16:49
11
October 19, 2023 16:50
12
if (!appeal) return jsonError("Appeal not found", 404);
October 19, 2023 16:49
13
14
await context.env.D1.prepare("DELETE FROM game_appeals WHERE id = ?;")
15
.bind(appealId)
16
.run();
May 13, 2024 15:01
17
October 19, 2023 16:49
18
await context.env.DATA.put(
19
`gameappealblock_${appeal.roblox_id}`,
October 19, 2023 16:49
20
`${Date.now() + 2592000000}`,
21
{ expirationTtl: 2592000 },
October 19, 2023 16:49
22
);
23
24
return new Response(null, {
25
status: 204,
26
});
27
}