import { NextRequest, NextResponse } from "next/server"; import { toErrorResponse } from "@/lib/render-pipeline/errors"; import { requirePipelineAdmin } from "@/lib/render-pipeline/session-auth"; import { markExportDoneManually } from "@/lib/render-pipeline/exports"; // ── POST /api/render/exports/{exportId}/mark-done ──────────────────────────── // // Phase 1 stopgap (§17.1): lets the studio keep using the old manual render // path while the queue is validated. Remove once workers render for real. export async function POST( req: NextRequest, { params }: { params: Promise<{ exportId: string }> } ) { try { const user = await requirePipelineAdmin(); const { exportId } = await params; let note: string | undefined; try { const body = await req.json(); if (typeof body?.note === "string") note = body.note; } catch { // empty body is fine } const result = await markExportDoneManually(exportId, user.id, note); return NextResponse.json(result); } catch (err) { const { body, status } = toErrorResponse(err); return NextResponse.json(body, { status }); } }