vendors can be updated through datomic.

This commit is contained in:
Bryce Covert
2018-11-09 13:30:27 -08:00
parent de8563a60b
commit 8ea4ea0c73
12 changed files with 141 additions and 276 deletions

View File

@@ -111,17 +111,6 @@
(fn [db [_ new-invoices]]
(assoc-in db [:invoices :pending] new-invoices)))
(re-frame/reg-event-fx
::approve-invoices
(fn [cofx [_]]
{:http {:method :post
:token (-> cofx :db :user)
:uri (str "/api/invoices/approve"
(when-let [company-id (:id @(re-frame/subscribe [::subs/company]))]
(str "?company=" company-id)))
:on-success [::received-invoices :pending]
}}))
(re-frame/reg-event-fx
::view-pending-invoices
(fn [cofx []]
@@ -143,16 +132,6 @@
[:id :total :invoice-number :date [:vendor [:name :id]] [:company [:name :id]]]]]}
:on-success [::received-invoices :unpaid]}}))
(re-frame/reg-event-fx
::reject-invoices
(fn [cofx [_]]
{:http {:method :post
:token (-> cofx :db :user)
:uri (str "/api/invoices/reject"
(when-let [company-id (:id @(re-frame/subscribe [::subs/company]))]
(str "?company=" company-id)))
:on-success [::received-invoices :pending]
}}))
(re-frame/reg-event-db
::submitted-new-invoice
(fn [db [_ invoice]]