Adding new clients works
This commit is contained in:
@@ -123,7 +123,7 @@
|
|||||||
(-> db
|
(-> db
|
||||||
(stop-form ::new-client)
|
(stop-form ::new-client)
|
||||||
(assoc-in [:admin :adding-client?] false)
|
(assoc-in [:admin :adding-client?] false)
|
||||||
(assoc-in [:clients (:id (:edit-client client))] (:edit-client client)))))
|
(assoc-in [:clients (:id (:edit-client client))] (update (:edit-client client) :bank-accounts (fn [bas] (->> bas (sort-by :sort-order) vec)))))))
|
||||||
|
|
||||||
(re-frame/reg-event-db
|
(re-frame/reg-event-db
|
||||||
::save-error
|
::save-error
|
||||||
@@ -390,13 +390,17 @@
|
|||||||
|
|
||||||
[:div.field
|
[:div.field
|
||||||
[:p.help "Client code"]
|
[:p.help "Client code"]
|
||||||
[:div.control
|
(if (:id new-client)
|
||||||
[bind-field
|
[:div.control
|
||||||
[:input.input {:type "code"
|
(:code new-client)
|
||||||
:field :code
|
]
|
||||||
:spec ::entity/code
|
[:div.control
|
||||||
:event ::change-new
|
[bind-field
|
||||||
:subscription new-client}]]]]
|
[:input.input {:type "code"
|
||||||
|
:field :code
|
||||||
|
:spec ::entity/code
|
||||||
|
:event ::change-new
|
||||||
|
:subscription new-client}]]])]
|
||||||
|
|
||||||
[:div.field
|
[:div.field
|
||||||
[:p.help "Email"]
|
[:p.help "Email"]
|
||||||
@@ -441,19 +445,12 @@
|
|||||||
[:a.button.is-primary.is-outlined.is-fullwidth {:on-click (dispatch-event [::add-new-bank-account :cash])} "Add Cash Account"]]]
|
[:a.button.is-primary.is-outlined.is-fullwidth {:on-click (dispatch-event [::add-new-bank-account :cash])} "Add Cash Account"]]]
|
||||||
|
|
||||||
#_[:h2.subtitle "Add bank account"]
|
#_[:h2.subtitle "Add bank account"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#_(when (:saving? new-client) [:div.is-overlay {:style {"backgroundColor" "rgba(150,150,150, 0.5)"}}])
|
#_(when (:saving? new-client) [:div.is-overlay {:style {"backgroundColor" "rgba(150,150,150, 0.5)"}}])
|
||||||
#_(println (s/explain-data ::entity/client new-client))
|
#_(println (s/explain-data ::entity/client new-client))
|
||||||
|
|
||||||
(when error
|
(when error
|
||||||
[:div.notification.is-warning.animated.fadeInUp
|
[:div.notification.is-warning.animated.fadeInUp
|
||||||
error])
|
error])
|
||||||
|
|
||||||
(println (s/explain-data ::entity/client @(re-frame/subscribe [::new-client-request])))
|
|
||||||
|
|
||||||
[:submit.button.is-large.is-primary {:disabled (if (s/valid? ::entity/client @(re-frame/subscribe [::new-client-request]))
|
[:submit.button.is-large.is-primary {:disabled (if (s/valid? ::entity/client @(re-frame/subscribe [::new-client-request]))
|
||||||
""
|
""
|
||||||
"disabled")
|
"disabled")
|
||||||
|
|||||||
Reference in New Issue
Block a user