fix: bad ignore no settings update

This commit is contained in:
2026-03-09 23:48:08 +01:00
parent c81f7ce1b7
commit 7eb9e2dcad
3 changed files with 39 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
import { NextRequest, NextResponse } from "next/server";
import { updateLibraryMonitoring } from "@/lib/api";
export async function PATCH(
request: NextRequest,
{ params }: { params: Promise<{ id: string }> }
) {
const { id } = await params;
try {
const { monitor_enabled, scan_mode, watcher_enabled } = await request.json();
const data = await updateLibraryMonitoring(id, monitor_enabled, scan_mode, watcher_enabled);
return NextResponse.json(data);
} catch (error) {
const message = error instanceof Error ? error.message : "Failed to update monitoring settings";
console.error("[monitoring PATCH]", message);
return NextResponse.json({ error: message }, { status: 500 });
}
}