Add vendor pre-population for bulk code and individual edit forms
- Add vendor-changed HTMX handlers for both bulk code and individual edit - Pre-populate default account at 100% when vendor is selected and no accounts exist - Fix render-accounts-section to render from step-params correctly - Change bulk code vendor-changed from hx-get to hx-post to include form data - Add routes for vendor-changed endpoints - Update e2e tests to cover vendor pre-population - Run lein cljfmt fix across codebase
This commit is contained in:
@@ -39,11 +39,11 @@
|
||||
"Return a list of name-value pairs for a parameter map."
|
||||
[params]
|
||||
(mapcat
|
||||
(fn [[name value]]
|
||||
(if (and (sequential? value) (not (coll? (first value))))
|
||||
(for [v value] [name v])
|
||||
[[name value]]))
|
||||
params))
|
||||
(fn [[name value]]
|
||||
(if (and (sequential? value) (not (coll? (first value))))
|
||||
(for [v value] [name v])
|
||||
[[name value]]))
|
||||
params))
|
||||
|
||||
(defn- nest-params
|
||||
"Takes a flat map of parameters and turns it into a nested map of
|
||||
@@ -51,10 +51,10 @@
|
||||
into keys."
|
||||
[params parse]
|
||||
(reduce
|
||||
(fn [m [k v]]
|
||||
(assoc-nested m (parse k) v))
|
||||
{}
|
||||
(param-pairs params)))
|
||||
(fn [m [k v]]
|
||||
(assoc-nested m (parse k) v))
|
||||
{}
|
||||
(param-pairs params)))
|
||||
|
||||
(defn nested-params-request
|
||||
"Converts a request with a flat map of parameters to a nested map.
|
||||
|
||||
Reference in New Issue
Block a user