import { projectRef } from "@/lib/projects"; import { listTakes, readVerdicts } from "@/lib/report/takes.mjs"; export const dynamic = "force-dynamic"; // GET ?project= every take, grouped, what was skipped and why, and the // verdicts so far. `exists: false` is a project with no // takes/ at all, which is the normal state, not an error. export async function GET(request: Request) { const url = new URL(request.url); const project = await projectRef(url.searchParams.get("project") ?? ""); if (!project) return Response.json({ error: "no such project" }, { status: 404 }); const [takes, verdicts] = await Promise.all([listTakes(project.dir), readVerdicts(project.dir)]); return Response.json({ project: project.id, ...takes, verdicts }, { headers: { "cache-control": "no-store" } }); }