This commit is contained in:
2026-06-23 22:03:26 -07:00
parent 2e3c1e3646
commit e8cbd2760c
7 changed files with 110 additions and 45 deletions

View File

@@ -265,8 +265,12 @@
(defn transaction-account-row* [{:keys [value client-id amount-mode total]}]
(com/data-grid-row
(-> {:class "account-row"
;; accountId is bound to the typeahead's value.value (and thus the
;; submitted hidden input). Normalize a {:db/id n} ref-map down to a bare
;; id so it doesn't serialize to "[object Object]" on submit.
:x-data (hx/json {:show (boolean (not (fc/field-value (:new? value))))
:accountId (fc/field-value (:transaction-account/account value))})
:accountId (let [a (fc/field-value (:transaction-account/account value))]
(or (:db/id a) a))})
:data-key "show"
:x-ref "p"}
hx/alpine-mount-then-appear)
@@ -331,8 +335,12 @@
(defn transaction-account-row-no-cursor* [{:keys [account index client-id amount-mode total]}]
(com/data-grid-row
(-> {:class "account-row"
;; accountId drives the typeahead's x-model and is bound to value.value.
;; Use a bare entity id, not the {:db/id n} ref-map, or the bound hidden
;; input serializes to "[object Object]" on submit (rejected server-side).
:x-data (hx/json {:show true
:accountId (:transaction-account/account account)})
:accountId (let [a (:transaction-account/account account)]
(or (:db/id a) a))})
:data-key "show"
:x-ref "p"}
hx/alpine-mount-then-appear)