a little ux

This commit is contained in:
Bryce Covert
2017-12-09 14:49:09 -08:00
parent 02a1ad0d47
commit e368b719ec
4 changed files with 35 additions and 22 deletions

View File

@@ -32,7 +32,8 @@
(re-frame/reg-event-fx
::view-unpaid-invoices
(fn [cofx []]
{:http {:method :get
{:db (assoc-in (:db cofx) [:status :loading] true)
:http {:method :get
:uri "/api/invoices/unpaid"
:on-success [::received-invoices :unpaid]}}))
@@ -47,4 +48,7 @@
(re-frame/reg-event-db
::received-invoices
(fn [db [_ type new-invoices]]
(assoc-in db [:invoices type] new-invoices)))
(-> db
(assoc-in [:invoices type] new-invoices)
(assoc-in [:status :loading] false)
)))