import { NextResponse } from "next/server";
import { requireAdminApiUser } from "@/lib/auth/admin";
import { getM7DatasetForUser } from "@/lib/compliance/server";

export async function GET() {
  const user = await requireAdminApiUser();

  if (!user) {
    return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
  }

  const dataset = await getM7DatasetForUser(user.id);
  return NextResponse.json({ ok: true, dataset });
}
