ability to approve
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[auto-ap.db :as db]
|
||||
[auto-ap.routes :as routes]
|
||||
|
||||
[bidi.bidi :as bidi]))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
@@ -20,6 +21,19 @@
|
||||
(fn [db [_ new-invoices]]
|
||||
(assoc-in db [:invoices] new-invoices)))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::invoices-approved
|
||||
(fn [db [_ new-invoices]]
|
||||
(assoc-in db [:invoices :pending] new-invoices)))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::approve-invoices
|
||||
(fn [cofx [_]]
|
||||
{:http {:method :post
|
||||
:uri "/api/invoices/approve"
|
||||
:on-success ::invoices-approved
|
||||
}}))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::received-invoices
|
||||
(fn [db [_ type new-invoices]]
|
||||
|
||||
Reference in New Issue
Block a user