Migrate the rest of the easy stuff
This commit is contained in:
@@ -2,18 +2,22 @@ import { jsonError } from "../../../common.js";
|
||||
|
||||
export async function onRequestPost(context: RequestContext) {
|
||||
const appealId = context.params.id as string;
|
||||
|
||||
const appeal = await context.env.D1.prepare(
|
||||
"SELECT * FROM game_appeals WHERE id = ?;",
|
||||
)
|
||||
.bind(appealId)
|
||||
.first();
|
||||
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.env.D1.prepare("DELETE FROM game_appeals WHERE id = ?;")
|
||||
.bind(appealId)
|
||||
.run();
|
||||
await context.data.prisma.gameAppeal.delete({
|
||||
where: {
|
||||
id: appealId,
|
||||
},
|
||||
});
|
||||
|
||||
await context.env.DATA.put(
|
||||
`gameappealblock_${appeal.roblox_id}`,
|
||||
|
||||
Reference in New Issue
Block a user