import { caseView, verifyCase } from "@/lib/research/boards"; import { fail, ok } from "../../../_respond"; export const dynamic = "force-dynamic"; // RE-VERIFY (the API is documented in ../../route.ts): every quote (or the // ones named) read again at its cite in the CURRENT transcript. Drifted or // missing is recorded with what is there now; a quote's own words never // change here. { quotes?: [qid] } -> { results: [{ id, verify }], case: CaseView } export async function POST(request: Request, ctx: { params: Promise<{ id: string }> }) { try { const { id } = await ctx.params; const body = (await request.json().catch(() => ({}))) as { quotes?: unknown } | null; const only = Array.isArray(body?.quotes) ? body.quotes.filter((x): x is string => typeof x === "string") : undefined; const r = await verifyCase(id, only); return ok({ results: r.results, case: await caseView(id) }); } catch (e) { return fail(e); } }