Initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { assertLocalRequest } from "@/lib/api/localOnly";
|
||||
import { cancelJob } from "@/lib/whisperjav/queue";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function POST(req: NextRequest, ctx: { params: Promise<{ id: string }> }) {
|
||||
const blocked = assertLocalRequest(req);
|
||||
if (blocked) return blocked;
|
||||
|
||||
const { id } = await ctx.params;
|
||||
const ok = cancelJob(id);
|
||||
if (!ok) return NextResponse.json({ error: "Not found or not cancellable" }, { status: 404 });
|
||||
return NextResponse.json({ ok: true });
|
||||
}
|
||||
Reference in New Issue
Block a user