import { moveChannelMediaBackAction } from "../../../channels/[slug]/storageActions"; import { ops, queueResponse, reqSlugs } from "../_lib"; import { queueForSlugs } from "../../../channels/lib/queueForSlugs"; export const dynamic = "force-dynamic"; // POST { slugs: string[] } -> { ok: true, queued, skipped } // // One job per slug on the shared relocation queue, and the per-channel action's // own busy guard decides each one — the same fan-out loop the bulk move uses, // so a refusal reads identically whether it came from the panel or from here. export async function POST(request: Request) { return ops(request, ["slugs"], async (body) => queueResponse( await queueForSlugs(reqSlugs(body, "slugs"), { run: (slug) => moveChannelMediaBackAction(slug), }), ), ); }