import { jsonError } from "../../common.js";

export async function onRequestPost(context: RequestContext) {
  const { user } = context.data.body;

  if (!user) return jsonError("No user provided", 400);

  await context.env.DATA.delete(`gamemod_${user}`);

  return new Response(null, {
    status: 204,
  });
}
