Can edit locations now.
This commit is contained in:
@@ -16,9 +16,12 @@
|
||||
(re-frame/reg-sub
|
||||
::account-request
|
||||
:<- [::forms/form ::form]
|
||||
(fn [{{:keys [id type numeric-code name account-set]} :data}]
|
||||
(fn [{{:keys [id location type numeric-code name account-set]} :data}]
|
||||
{:id id
|
||||
:type (keyword type)
|
||||
:location (if (clojure.string/blank? location)
|
||||
nil
|
||||
location)
|
||||
:numeric-code numeric-code
|
||||
:name name
|
||||
:account-set account-set}))
|
||||
@@ -47,7 +50,7 @@
|
||||
:operation/name "UpsertAccount"}
|
||||
:venia/queries [{:query/data [:upsert-account
|
||||
{:account @(re-frame/subscribe [::account-request])}
|
||||
[:id :type :name :account-set :numeric-code]]}]}
|
||||
[:id :type :name :account-set :numeric-code :location]]}]}
|
||||
:on-success [::edited edit-completed]
|
||||
:on-error [::forms/save-error ::form]}}))))
|
||||
|
||||
@@ -112,6 +115,17 @@
|
||||
(map (fn [l]
|
||||
[:option {:value (name l)} (str/capitalize (name l))]) types)]]]]]
|
||||
|
||||
|
||||
[:div.field
|
||||
[:p.help "Location"]
|
||||
[:div.control
|
||||
[bind-field
|
||||
[:input.input.known-field.location {:type "text"
|
||||
:field :location
|
||||
:spec ::entity/location
|
||||
:event change-event
|
||||
:subscription account}]]]]
|
||||
|
||||
(when error
|
||||
[:div.notification.is-warning.animated.fadeInUp
|
||||
error])
|
||||
|
||||
Reference in New Issue
Block a user