Log appeal denials
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
import { jsonError } from "../../../common.js";
|
import { jsonError } from "../../../common.js";
|
||||||
|
import { getBanList } from "../../../roblox-open-cloud.js";
|
||||||
|
|
||||||
export async function onRequestPost(context: RequestContext) {
|
export async function onRequestPost(context: RequestContext) {
|
||||||
const appealId = context.params.id as string;
|
const appealId = context.params.id as string;
|
||||||
const appeal = await context.data.prisma.gameAppeal.findUnique({
|
const appeal = await context.data.prisma.gameAppeal.findUnique({
|
||||||
select: {
|
select: {
|
||||||
roblox_id: true,
|
roblox_id: true,
|
||||||
|
type: true,
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
id: appealId,
|
id: appealId,
|
||||||
@@ -19,6 +21,18 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { value: banList } = await getBanList(context);
|
||||||
|
|
||||||
|
await context.data.prisma.gameModLog.create({
|
||||||
|
data: {
|
||||||
|
action: `deny appeal | ${banList[appeal.roblox_id]?.BanType === 2 ? "ban" : appeal.type}`,
|
||||||
|
evidence: `https://carcrushers.cc/mod-queue?id=${context.params.id}&type=gma`,
|
||||||
|
executor: context.data.current_user.id,
|
||||||
|
id: crypto.randomUUID(),
|
||||||
|
target: appeal.roblox_id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
await context.env.DATA.put(
|
await context.env.DATA.put(
|
||||||
`gameappealblock_${appeal.roblox_id}`,
|
`gameappealblock_${appeal.roblox_id}`,
|
||||||
`${Date.now() + 2592000000}`,
|
`${Date.now() + 2592000000}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user