import { NextResponse } from "next/server"; import { withAuth } from "@/lib/api-auth"; import { apiError, handleApiError } from "@/lib/api-errors"; import { applyUpdate, ModelError } from "@/lib/models"; /** Update to the newer commit found by the last Hub check (deliberate, never automatic). */ export const POST = withAuth>(async (_req, { params }) => { const { id } = await params; try { return NextResponse.json(await applyUpdate(id), { status: 201 }); } catch (err) { if (err instanceof ModelError) return apiError(err.status, err.code, err.message); return handleApiError(err); } });