reject supported.
This commit is contained in:
@@ -26,6 +26,11 @@
|
||||
(fn [db [_ new-invoices]]
|
||||
(assoc-in db [:invoices :pending] new-invoices)))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::invoices-rejected
|
||||
(fn [db [_ new-invoices]]
|
||||
(assoc-in db [:invoices :pending] new-invoices)))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::approve-invoices
|
||||
(fn [cofx [_]]
|
||||
@@ -34,6 +39,14 @@
|
||||
:on-success ::invoices-approved
|
||||
}}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::reject-invoices
|
||||
(fn [cofx [_]]
|
||||
{:http {:method :post
|
||||
:uri "/api/invoices/reject"
|
||||
:on-success ::invoices-rejected
|
||||
}}))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::received-invoices
|
||||
(fn [db [_ type new-invoices]]
|
||||
|
||||
@@ -121,6 +121,9 @@
|
||||
(re-frame/dispatch [::events/approve-invoices]))}
|
||||
"Approve all"]
|
||||
[:a.card-footer-item
|
||||
{:on-click (fn [e]
|
||||
(.preventDefault e)
|
||||
(re-frame/dispatch [::events/reject-invoices]))}
|
||||
"Reject all"]
|
||||
]]]))
|
||||
{:component-did-mount (fn []
|
||||
|
||||
Reference in New Issue
Block a user