mirror of
https://github.com/monoscope-tech/monoscope.git
synced 2026-11-16 10:18:01 +00:00
fix(widget): drop the blanket FromHttpApiData orphan that hijacked query-param parsing
Pkg/Components/Widget declared
instance {-# OVERLAPPABLE #-} AE.FromJSON a => FromHttpApiData a
which meant every module transitively importing Widget parsed query params for
any JSON-decodable type through AE.eitherDecodeStrict — so a param only ever
parsed if it was a *quoted* JSON string. Nothing actually needed the blanket
form; what the FromForm derivations need is container and per-type instances.
Replaced with narrow ones in Utils, beside the existing JSONHttpApiData:
[a], V.Vector a and AE.Value. The four record types now derive FromHttpApiData
via JSONHttpApiData, and WidgetType/SummarizeBy derive it via WrappedEnumSC, so
they parse the bare snake_case spelling a form submits (widget_type=top_list)
rather than requiring quotes.
Also dropped two redundant imports in Pages/Charts/Charts.hs that Relude already
re-exports. The watcher now reports All good with zero warnings.
This commit is contained in:
parent
c7c187d6fd
commit
7625d7de1b
3 changed files with 35 additions and 13 deletions
Loading…
Add table
Add a link
Reference in a new issue