Added the ability to import invoices again

This commit is contained in:
Bryce Covert
2019-02-11 20:48:43 -08:00
parent 085440bedd
commit 7c01a04ee8
13 changed files with 196 additions and 22 deletions

View File

@@ -4,6 +4,8 @@
[auto-ap.events :as events]
[auto-ap.subs :as subs]
[auto-ap.entities.clients :as client]
[auto-ap.views.components.layouts :refer [side-bar-layout]]
[auto-ap.views.components.invoices.side-bar :refer [invoices-side-bar]]
[auto-ap.entities.vendors :as vendor]
[auto-ap.views.components.invoice-table :refer [invoice-table] :as invoice-table]
[cljsjs.dropzone :as dropzone]
@@ -56,7 +58,7 @@
(assoc-in [:status :loading] true)
(assoc-in [::params] params))
:graphql {:token (-> cofx :db :user)
:query-obj (invoice-table/query (assoc params :imported false))
:query-obj (invoice-table/query (assoc params :import-status "pending"))
:on-success [::received]}}))
(re-frame/reg-event-db
@@ -88,7 +90,7 @@
:on-success on-success
}}))
(def import-invoices-page
(def import-invoices-content
(with-meta
(fn []
(let [invoice-page (re-frame/subscribe [::invoice-page])
@@ -129,3 +131,9 @@
"Reject all"]])]]))
{:component-will-mount (fn []
(re-frame/dispatch-sync [::invalidated]))}))
(defn import-invoices-page []
[side-bar-layout {:side-bar [invoices-side-bar {}]
:main [import-invoices-content ]}])

View File

@@ -80,7 +80,7 @@
(assoc-in [:status :loading] true)
(assoc-in [::params] params))
:graphql {:token (-> cofx :db :user)
:query-obj (invoice-table/query (-> params (assoc :imported true) (dissoc :invoice-number-like-current)) )
:query-obj (invoice-table/query (-> params (assoc :import-status "imported") (dissoc :invoice-number-like-current)) )
:on-success [::received]}}))
(re-frame/reg-event-db
::unmount-invoices