fix: pass metadata_refresh_mode through backoffice proxy to API
The Next.js monitoring route was dropping metadata_refresh_mode from the request body, so the value was never forwarded to the Rust API and reverted on reload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,8 @@ export type LibraryDto = {
|
||||
watcher_enabled: boolean;
|
||||
metadata_provider: string | null;
|
||||
fallback_metadata_provider: string | null;
|
||||
metadata_refresh_mode: string;
|
||||
next_metadata_refresh_at: string | null;
|
||||
};
|
||||
|
||||
export type IndexJobDto = {
|
||||
@@ -192,11 +194,13 @@ export async function updateLibraryMonitoring(
|
||||
monitorEnabled: boolean,
|
||||
scanMode: string,
|
||||
watcherEnabled?: boolean,
|
||||
metadataRefreshMode?: string,
|
||||
) {
|
||||
const body: {
|
||||
monitor_enabled: boolean;
|
||||
scan_mode: string;
|
||||
watcher_enabled?: boolean;
|
||||
metadata_refresh_mode?: string;
|
||||
} = {
|
||||
monitor_enabled: monitorEnabled,
|
||||
scan_mode: scanMode,
|
||||
@@ -204,6 +208,9 @@ export async function updateLibraryMonitoring(
|
||||
if (watcherEnabled !== undefined) {
|
||||
body.watcher_enabled = watcherEnabled;
|
||||
}
|
||||
if (metadataRefreshMode !== undefined) {
|
||||
body.metadata_refresh_mode = metadataRefreshMode;
|
||||
}
|
||||
return apiFetch<LibraryDto>(`/libraries/${libraryId}/monitoring`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(body),
|
||||
|
||||
Reference in New Issue
Block a user