Fixes an issue with adding accounts.

This commit is contained in:
2024-01-18 20:04:48 -08:00
parent a04832db52
commit 57f1805b55
2 changed files with 6 additions and 6 deletions

View File

@@ -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

View File

@@ -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)))))