you can check off individual invoices
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
[auto-ap.entities.vendors :as vendor]
|
||||
[auto-ap.events :as events]
|
||||
[auto-ap.views.utils :refer [dispatch-event]]
|
||||
[auto-ap.views.pages.check :as check]
|
||||
[auto-ap.views.components.invoice-table :refer [invoice-table] :as invoice-table]
|
||||
[auto-ap.subs :as subs]
|
||||
[auto-ap.events :as events]))
|
||||
@@ -54,9 +55,16 @@
|
||||
:body (pr-str {:invoice-ids (get-in db [::invoice-page :checked])})
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:uri (str "/api/checks/")
|
||||
:on-success [::save-complete]
|
||||
:on-success [::checks-created]
|
||||
:on-error [::save-error]}}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::checks-created
|
||||
(fn [{:keys [db]} [_ data]]
|
||||
{:dispatch [:auto-ap.events/set-active-page :check]
|
||||
:db (-> db
|
||||
(assoc ::check/checks data))}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::invalidated
|
||||
(fn [cofx [_ params]]
|
||||
|
||||
Reference in New Issue
Block a user