diff --git a/functions/api/appeals/[id]/accept.ts b/functions/api/appeals/[id]/accept.ts index 156717d..739ac2c 100644 --- a/functions/api/appeals/[id]/accept.ts +++ b/functions/api/appeals/[id]/accept.ts @@ -40,6 +40,8 @@ export async function onRequestPost(context: RequestContext) { delete appeal.fcm_token; delete appeal.user.email; + appeal.open = false; + await context.env.DATA.put(`appeal_${appeal.id}`, JSON.stringify(appeal), { expirationTtl: 94608000, }); diff --git a/functions/api/appeals/[id]/deny.ts b/functions/api/appeals/[id]/deny.ts index ebdb361..a9982ef 100644 --- a/functions/api/appeals/[id]/deny.ts +++ b/functions/api/appeals/[id]/deny.ts @@ -41,6 +41,12 @@ export async function onRequestPost(context: RequestContext) { delete appeal.user.email; delete appeal.fcm_token; + appeal.open = false; + + await context.env.DATA.put(`appeal_${appeal.id}`, JSON.stringify(appeal), { + expirationTtl: 94608000, + }); + await fetch(context.env.APPEALS_WEBHOOK, { body: JSON.stringify({ embeds: [ diff --git a/functions/api/appeals/submit.ts b/functions/api/appeals/submit.ts index f3bcbd0..9bf1c2e 100644 --- a/functions/api/appeals/submit.ts +++ b/functions/api/appeals/submit.ts @@ -82,6 +82,7 @@ export async function onRequestPost(context: RequestContext) { fcm_token: typeof senderTokenId === "string" ? senderTokenId : undefined, learned, id: appealId, + open: true, reason_for_unban: whyUnban, user: { email: currentUser.email, diff --git a/index.d.ts b/index.d.ts index 802d264..d9eec28 100644 --- a/index.d.ts +++ b/index.d.ts @@ -5,28 +5,18 @@ declare global { ASSETS: Fetcher; D1: D1Database; DATA: KVNamespace; + [k: string]: string; } type RequestContext = EventContext; - interface EmotionCriticalToChunks { - html: string; - styles: { key: string; ids: string[]; css: string }[]; - } - - interface EmotionServer { - constructStyleTagsFromChunks: ( - criticalData: EmotionCriticalToChunks, - ) => string; - extractCriticalToChunks: (html: string) => EmotionCriticalToChunks; - } - interface AppealCardProps { ban_reason: string; created_at: number; id: string; learned: string; + open?: boolean; reason_for_unban: string; user: { id: string;