diff --git a/functions/api/gme/remove.ts b/functions/api/gme/remove.ts new file mode 100644 index 0000000..2b0b5dd --- /dev/null +++ b/functions/api/gme/remove.ts @@ -0,0 +1,17 @@ +export async function onRequestPost(context: RequestContext) { + const { user } = context.data.body; + + if (!user) + return new Response('{"error":"No user provided"}', { + headers: { + "content-type": "application/json", + }, + status: 400, + }); + + await context.env.DATA.delete(`gamemod_${user}`); + + return new Response(null, { + status: 204, + }); +}