Create GME remove endpoint
This commit is contained in:
parent
bef8f6f7ea
commit
3ab93c707b
17
functions/api/gme/remove.ts
Normal file
17
functions/api/gme/remove.ts
Normal file
@ -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,
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user