You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(api): correct data serialization for all repositories
The generic data routes were failing with a type cast error (`DateTime` is not a subtype of `String?`) when reading from the database. This was because the `postgres` driver returns native `DateTime` objects, while the models' `fromJson` factories expect ISO 8601 strings.
This change implements custom `fromJson` functions for all relevant repositories (`headline`, `category`, `source`, `country`, `appConfig`, `userAppSettings`). These functions pre-process the data from the database, converting `DateTime` objects to the expected string format before deserialization.
Additionally, it corrects the `toJson` logic for the `userAppSettingsRepository` to properly JSON-encode its complex fields for `JSONB` columns. This resolves all known data serialization and deserialization errors.
0 commit comments