New formatting
This commit is contained in:
@ -19,7 +19,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
status: 400,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const { current_user: currentUser } = context.data;
|
||||
@ -36,13 +36,13 @@ export async function onRequestPost(context: RequestContext) {
|
||||
prefix: `appeal_${currentUser.id}`,
|
||||
});
|
||||
const existingBlockedAppeal = await context.env.DATA.get(
|
||||
`blockedappeal_${currentUser.id}`
|
||||
`blockedappeal_${currentUser.id}`,
|
||||
);
|
||||
|
||||
if (
|
||||
existingBlockedAppeal ||
|
||||
existingAppeals.keys.find(
|
||||
(appeal) => (appeal.metadata as { [k: string]: any })?.open
|
||||
(appeal) => (appeal.metadata as { [k: string]: any })?.open,
|
||||
)
|
||||
)
|
||||
return new Response('{"error":"Appeal already submitted"}', {
|
||||
@ -82,7 +82,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
}),
|
||||
{
|
||||
expirationTtl: 94608000,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await fetch(context.env.APPEALS_WEBHOOK, {
|
||||
|
Reference in New Issue
Block a user