Intelligence
Artifacts
Browse the repository, read documents, and manage the governance folders. Source, runtime, and infrastructure are read-only.
Repository
repositories/aaf-holdings/hq01/app/api/missions/[id]/archive/route.ts
777 B
import { NextResponse } from "next/server";
import { archiveMission, MissionError } from "@/lib/missions/manager";
/**
* Archive a mission (status → Archived).
*
* POST /api/missions/:id/archive
*/
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export async function POST(
_request: Request,
{ params }: { params: { id: string } },
) {
try {
const mission = archiveMission(params.id);
return NextResponse.json({ ok: true, mission });
} catch (err) {
if (err instanceof MissionError) {
return NextResponse.json({ error: err.message }, { status: err.status });
}
const message = err instanceof Error ? err.message : "Archive failed.";
return NextResponse.json({ error: message }, { status: 500 });
}
}
root · /srv/aaf