import { NextResponse } from "next/server"; import { withAuth } from "@/lib/api-auth"; import { apiError, handleApiError } from "@/lib/api-errors"; import { DeploymentError, setDesiredState } from "@/lib/deployments"; export const POST = withAuth>(async (_req, { params }) => { try { await setDesiredState((await params).id, "running"); return new NextResponse(null, { status: 202 }); } catch (err) { if (err instanceof DeploymentError) return apiError(err.status, err.code, err.message); return handleApiError(err); } });