Minor fixes

This commit is contained in:
Bryce Covert
2020-09-17 22:28:53 -07:00
parent 2e18e2da26
commit 12f9982cd7
5 changed files with 66 additions and 5 deletions

View File

@@ -61,7 +61,8 @@
[:vendor
vendor-query]
[:accounts [:numeric-code :location :name :type :account_set :applicability :id [:client-overrides [:name :id [:client [:name :id]]]]]]]}
:on-success [::received-initial]}}))))
:on-success [::received-initial]
:on-error [::failed-initial]}}))))
(re-frame/reg-event-db
@@ -82,7 +83,8 @@
vendor-query]
[:accounts [:numeric-code :name :location :type :account_set :applicability :id [:client-overrides [:name [:client [:name :id]]]]]]]}
:on-success [::received-initial]}
:on-success [::received-initial]
:on-error [::failed-initial]}
:db (assoc db
:user (assoc user :token token)
:is-initial-loading? true)}))
@@ -102,6 +104,14 @@
(filter #(= % (:last-client-id db)))
first))))))
(re-frame/reg-event-db
::failed-initial
(fn [db [_ e]]
(assoc db :initial-error e
:is-initial-loading? false
:active-page :initial-error)))
(re-frame/reg-event-db
::swap-client
(fn [db [_ client]]