diff --git a/backend/services/database.py b/backend/services/database.py index e85b488..749bb71 100644 --- a/backend/services/database.py +++ b/backend/services/database.py @@ -5135,7 +5135,8 @@ def get_all_ai_desks() -> List[Dict[str, Any]]: d = dict(r) for f in ("instruments", "config"): try: - d[f] = json.loads(d.get(f) or "[]" if f == "instruments" else "{}") + fallback = "[]" if f == "instruments" else "{}" + d[f] = json.loads(d.get(f) or fallback) except Exception: d[f] = [] if f == "instruments" else {} result.append(d) diff --git a/frontend/src/pages/AIDesks.tsx b/frontend/src/pages/AIDesks.tsx index 153a3bc..c5be8b6 100644 --- a/frontend/src/pages/AIDesks.tsx +++ b/frontend/src/pages/AIDesks.tsx @@ -377,14 +377,14 @@ function EcoConfig({ onChange: (c: Record) => void }) { const set = (k: string, v: any) => onChange({ ...config, [k]: v }) - const countries: string[] = config.countries ?? ECO_DEFAULT_COUNTRIES + const countries: string[] = config.currencies ?? ECO_DEFAULT_COUNTRIES const eventTypes: string[] = config.event_types ?? ECO_DEFAULT_TYPES const toggleCountry = (code: string) => { const next = countries.includes(code) ? countries.filter(c => c !== code) : [...countries, code] - set('countries', next) + set('currencies', next) } const toggleEventType = (id: string) => {