From c6a838a91ca4e7bd24f2191cdf2db4c9f889a01f Mon Sep 17 00:00:00 2001 From: X4Lo Date: Mon, 29 Jun 2026 05:18:07 +0100 Subject: [PATCH] Fix show_in_calendar and auto_sync toggles not persisting Map snake_case field names from frontend to Sequelize camelCase properties in controller. Normalize response back to snake_case so dialog switches read correct boolean values. --- react_frontend/src/lib/normalizers.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/react_frontend/src/lib/normalizers.ts b/react_frontend/src/lib/normalizers.ts index e52eeb8..f10414b 100644 --- a/react_frontend/src/lib/normalizers.ts +++ b/react_frontend/src/lib/normalizers.ts @@ -61,6 +61,9 @@ export function normalizeGenres(raw: any[]): Genre[] { export function normalizeEntry(raw: any): Entry { return { ...raw, + // Map Sequelize camelCase property names → snake_case for frontend consistency + show_in_calendar: raw.show_in_calendar ?? raw.showInCalendar ?? true, + auto_sync: raw.auto_sync ?? raw.autoSync ?? true, // Singular → plural aliases (coerce tmdb_id to number for store comparisons) entryIds: (() => { const ids = raw.entryIds ?? raw.entryId;