mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 13:36:48 +00:00
e615011e73
tags and pros_cons are JSON held in TEXT columns. Three read paths decoded them by hand and createEntry and updateEntry did not, so an edit answered with the raw row: tags came back as '["beach","sunset"]', the store spread it into an entry the client types as string[], and the journey page threw "tags.map is not a function" behind an error boundary. Any edit was enough to arm it. The update path writes JSON.stringify(val) with no length check, so even clearing an entry's tags stores '[]' and answers with that string. Neither compiler could see it: JourneyEntry describes the row, tags and all, and both sides read the same field name while only one of them was right. So the decoded shape gets a type of its own and one decoder, which is what turned up the third case - the early return for an update that changes nothing handed back a raw row too. Fixes #2085