import { openTriageBoard } from "@/lib/research/triage"; import { fail, ok } from "../../../../_respond"; export const dynamic = "force-dynamic"; // OPEN A TRIAGE AS A BOARD (R6; lib/research/triage.ts): POST makes, or brings // up to date, the research case of the run's flags (`by: "triage"`) -- the // escalation's article id, else `-t`. umtool is the one writer of // case files; the editor's tick never writes one. // POST -> { id, href, created, added, already, skipped } // 409 the run flagged nothing (or a case.json that does not read) export async function POST(_request: Request, ctx: { params: Promise<{ schedule: string; k: string }> }) { try { const { schedule, k } = await ctx.params; return ok(await openTriageBoard(decodeURIComponent(schedule), Number(k))); } catch (e) { return fail(e); } }