Permalink
Newer
100644
56 lines (45 sloc)
1.55 KB
3
4
export async function onRequestPost(context: RequestContext) {
5
const { statsReduction } = context.data.body;
6
7
if (statsReduction && typeof statsReduction !== "number")
10
const appeal: Record<string, any> | null = await context.env.D1.prepare(
11
"SELECT * FROM game_appeals WHERE id = ?;",
12
)
13
.bind(context.params.id)
14
.first();
17
18
const banList = (await getBanList(context)) as {
19
[k: string]: { BanType: number; Unbanned?: boolean; UnbanReduct?: number };
20
};
21
22
await context.env.DATA.delete(`gameappeal_${context.params.id as string}`);
23
await context.env.D1.prepare("DELETE FROM game_appeals WHERE id = ?;")
24
.bind(context.params.id)
25
.run();
38
await context.env.D1.prepare(
39
"INSERT INTO game_mod_logs (action, evidence, executed_at, executor, id, target) VALUES (?, ?, ?, ?, ?, ?);",
40
)
41
.bind(
42
"accept_appeal",
43
`https://carcrushers.cc/mod-queue?id=${context.params.id}&type=gma`,
44
Date.now(),
45
context.data.current_user.id,
46
crypto.randomUUID(),