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.
This commit is contained in:
1 parent
d12d7cb627
commit
c6a838a91c
1 file changed
+3
@@ -61,6 +61,9 @@ export function normalizeGenres(raw: any[]): Genre[] {
|
|||||||
export function normalizeEntry(raw: any): Entry {
|
export function normalizeEntry(raw: any): Entry {
|
||||||
return {
|
return {
|
||||||
...raw,
|
...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)
|
// Singular → plural aliases (coerce tmdb_id to number for store comparisons)
|
||||||
entryIds: (() => {
|
entryIds: (() => {
|
||||||
const ids = raw.entryIds ?? raw.entryId;
|
const ids = raw.entryIds ?? raw.entryId;
|
||||||
|
|||||||
Reference in new issue
Block a user