import { usePrisma } from "../../utils/prisma";

/**
 * DELETE /api/coach/history
 * Löscht den gespeicherten Chat-Verlauf (Pro/Legend).
 */
export default defineEventHandler(async (event) => {
  const user = await requireUser(event);

  const db = usePrisma();
  await db.coachSession.deleteMany({ where: { userId: user.id } });

  return { ok: true };
});
