18 lines
379 B
TypeScript
18 lines
379 B
TypeScript
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,
|
|
});
|
|
}
|