Migrate the rest of the easy stuff
This commit is contained in:
@@ -13,11 +13,12 @@ export async function onRequestPost(context: RequestContext) {
|
||||
fcm_token,
|
||||
);
|
||||
|
||||
await context.env.D1.prepare(
|
||||
"DELETE FROM push_notifications WHERE event_id = ? AND event_type = 'appeal';",
|
||||
)
|
||||
.bind(appeal.id)
|
||||
.run();
|
||||
await context.data.prisma.pushNotification.delete({
|
||||
where: {
|
||||
event_id: appeal.id,
|
||||
event_type: "appeal",
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const emailResponse = await sendEmail(
|
||||
appeal.user.email,
|
||||
@@ -37,11 +38,8 @@ export async function onRequestPost(context: RequestContext) {
|
||||
|
||||
const { current_user: currentUser } = context.data;
|
||||
|
||||
await context.env.D1.prepare(
|
||||
"UPDATE appeals SET approved = 1, user = json_remove(user, '$.email') WHERE id = ?;",
|
||||
)
|
||||
.bind(context.params.id)
|
||||
.run();
|
||||
await context.data.prisma
|
||||
.$executeRaw`UPDATE appeals SET approved = TRUE, user = json_remove(user, '$.id') WHERE id = ${appeal.id};`;
|
||||
|
||||
await fetch(
|
||||
`https://discord.com/api/v10/guilds/242263977986359297/bans/${appeal.user.id}`,
|
||||
|
||||
Reference in New Issue
Block a user