Adds a new job type that refreshes metadata from external providers for all series already linked via approved external_metadata_links. Tracks and displays per-field diffs (series and book level), respects locked fields, and provides a detailed change report in the job detail page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
603 B
TypeScript
17 lines
603 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
import { apiFetch } from "@/lib/api";
|
|
|
|
export async function GET(request: NextRequest) {
|
|
try {
|
|
const jobId = request.nextUrl.searchParams.get("job_id");
|
|
if (!jobId) {
|
|
return NextResponse.json({ error: "job_id required" }, { status: 400 });
|
|
}
|
|
const data = await apiFetch(`/metadata/refresh/${jobId}/report`);
|
|
return NextResponse.json(data);
|
|
} catch (error) {
|
|
const message = error instanceof Error ? error.message : "Failed to get report";
|
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
}
|
|
}
|