import { NextResponse } from "next/server"; import { clearPlatformHoldAction } from "../../../operations/pacingActions"; import { ops, opsFail, reqString } from "../_lib"; export const dynamic = "force-dynamic"; // POST { platform: "youtube" | "rumble" | … } // // The lane strip's "Clear hold": a held platform's hold, its backoff and its // raised pace all go, and the next failure starts the escalation from the // bottom. The action runs it as a one-step job (kind `clear-platform-hold`, on // its own queue) and waits for it, so the answer carries the job's sentence: // { ok, message } — "youtube had no hold, backoff or raised pace to clear." when // there was nothing to clear. export async function POST(request: Request) { return ops(request, ["platform"], async (body) => { const res = await clearPlatformHoldAction(reqString(body, "platform")); if (!res.ok) return opsFail(res.error); return NextResponse.json({ ok: true, message: res.message }); }); }