diff --git a/src/clj/auto_ap/ssr/admin/transaction_rules.clj b/src/clj/auto_ap/ssr/admin/transaction_rules.clj index ff000622..81f4b989 100644 --- a/src/clj/auto_ap/ssr/admin/transaction_rules.clj +++ b/src/clj/auto_ap/ssr/admin/transaction_rules.clj @@ -496,7 +496,7 @@ {:errors (fc/field-errors)} [:div {:hx-trigger "changed" :hx-target "next div" - :hx-vals (format "js:{name: '%s', 'client-id': event.detail.clientId, value: event.detail.accountId || ''}" account-name) + :hx-vals (format "js:{name: '%s', 'client-id': event.detail.clientId || '', value: event.detail.accountId || ''}" account-name) :hx-get (str (bidi/path-for ssr-routes/only-routes ::route/account-typeahead)) :x-init "$watch('clientId', cid => $dispatch('changed', $data));"}] (account-typeahead* {:value (fc/field-value) @@ -886,10 +886,10 @@ (wrap-schema-enforce :route-params [:map [:db/id entity-id]])) ::route/new-account (-> new-account (wrap-schema-enforce :query-schema [:map - [:client-id {:optional true} - [:maybe entity-id]] - [:index {:optional true - :default 0} [nat-int? {:default 0}]]]) + [:client-id {:optional true} + [:maybe entity-id]] + [:index {:optional true + :default 0} [nat-int? {:default 0}]]]) wrap-admin wrap-client-redirect-unauthenticated) ::route/location-select (-> location-select (wrap-schema-enforce :query-schema [:map diff --git a/src/clj/auto_ap/ssr/hx.clj b/src/clj/auto_ap/ssr/hx.clj index 370e27b3..2e54080c 100644 --- a/src/clj/auto_ap/ssr/hx.clj +++ b/src/clj/auto_ap/ssr/hx.clj @@ -46,7 +46,7 @@ (str/join ", " (map (fn [[field alpine-field]] - (format "\"%s\": $data.%s" field alpine-field)) + (format "\"%s\": $data.%s || ''" field alpine-field)) field->alpine-field)))))