fix(ssr): stop unresolved filter flipping to true on transactions navigation
The unresolved/potential-duplicates query-param decoders fell through to (boolean %) for unrecognized strings. A round-tripped "false" (pushed into the URL, re-read via HX-Current-URL) decoded to true since any non-nil string is truthy, so navigating pages silently turned on the "Unresolved only" filter. Handle "false" and already-boolean values symmetrically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -36,9 +36,9 @@
|
|||||||
[:import-batch-id {:optional true} [:maybe entity-id]]
|
[:import-batch-id {:optional true} [:maybe entity-id]]
|
||||||
[:unresolved {:optional true}
|
[:unresolved {:optional true}
|
||||||
[:maybe [:boolean {:decode/string {:enter #(cond (= % "on") true
|
[:maybe [:boolean {:decode/string {:enter #(cond (= % "on") true
|
||||||
(= % "") false
|
(= % "true") true
|
||||||
:else
|
(boolean? %) %
|
||||||
(boolean %))}}]]]
|
:else false)}}]]]
|
||||||
[:description {:optional true} [:maybe [:string {:decode/string strip}]]]
|
[:description {:optional true} [:maybe [:string {:decode/string strip}]]]
|
||||||
[:memo {:optional true} [:maybe [:string {:decode/string strip}]]]
|
[:memo {:optional true} [:maybe [:string {:decode/string strip}]]]
|
||||||
[:vendor {:optional true :default nil} [:maybe [:entity-map {:pull [:db/id :vendor/name]}]]]
|
[:vendor {:optional true :default nil} [:maybe [:entity-map {:pull [:db/id :vendor/name]}]]]
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
[:location {:optional true} [:maybe [:string {:decode/string strip}]]]
|
[:location {:optional true} [:maybe [:string {:decode/string strip}]]]
|
||||||
[:potential-duplicates {:optional true}
|
[:potential-duplicates {:optional true}
|
||||||
[:maybe [:boolean {:decode/string {:enter #(cond (= % "on") true
|
[:maybe [:boolean {:decode/string {:enter #(cond (= % "on") true
|
||||||
(= % "") false
|
(= % "true") true
|
||||||
:else
|
(boolean? %) %
|
||||||
(boolean %))}}]]]
|
:else false)}}]]]
|
||||||
#_[:status {:optional true} [:maybe (ref->enum-schema "transaction-status")]]
|
#_[:status {:optional true} [:maybe (ref->enum-schema "transaction-status")]]
|
||||||
[:exact-match-id {:optional true} [:maybe entity-id]]
|
[:exact-match-id {:optional true} [:maybe entity-id]]
|
||||||
[:all-selected {:optional true :default nil} [:maybe :boolean]]
|
[:all-selected {:optional true :default nil} [:maybe :boolean]]
|
||||||
|
|||||||
Reference in New Issue
Block a user