routes are now secured.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
::approve-invoices
|
||||
(fn [cofx [_]]
|
||||
{:http {:method :post
|
||||
:token (-> cofx :db :user)
|
||||
:uri (str "/api/invoices/approve"
|
||||
(when-let [company-name (-> cofx :db :company :name)]
|
||||
(str "?company=" company-name)))
|
||||
@@ -52,6 +53,7 @@
|
||||
(fn [cofx []]
|
||||
{:db (assoc-in (:db cofx) [:status :loading] true)
|
||||
:http {:method :get
|
||||
:token (-> cofx :db :user)
|
||||
:uri (str "/api/invoices/pending"
|
||||
(when-let [company-name (-> cofx :db :company :name)]
|
||||
(str "?company=" company-name)))
|
||||
@@ -62,6 +64,7 @@
|
||||
(fn [cofx []]
|
||||
{:db (assoc-in (:db cofx) [:status :loading] true)
|
||||
:http {:method :get
|
||||
:token (-> cofx :db :user)
|
||||
:uri (str "/api/invoices/unpaid"
|
||||
(when-let [company-name (-> cofx :db :company :name)]
|
||||
(str "?company=" company-name)))
|
||||
@@ -71,6 +74,7 @@
|
||||
::reject-invoices
|
||||
(fn [cofx [_]]
|
||||
{:http {:method :post
|
||||
:token (-> cofx :db :user)
|
||||
:uri (str "/api/invoices/reject"
|
||||
(when-let [company-name (-> cofx :db :company :name)]
|
||||
(str "?company=" company-name)))
|
||||
@@ -86,6 +90,7 @@
|
||||
(fn [{:keys [db]} [_ invoice]]
|
||||
|
||||
{:http {:method :post
|
||||
:token (-> db :user)
|
||||
:uri "/api/invoices"
|
||||
:body (pr-str {:rows [(assoc invoice :imported true)]})
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
|
||||
Reference in New Issue
Block a user