reject supported.

This commit is contained in:
Bryce Covert
2017-12-09 13:33:03 -08:00
parent bc6db905a5
commit 749b7b9633
4 changed files with 26 additions and 1 deletions

View File

@@ -14,6 +14,9 @@
(defn approve []
(map db->clj (j/update! conn :invoices {:imported true} [] )))
(defn reject []
(j/delete! conn :invoices ["imported = false"]))
(defn get-unpaid []
(map db->clj (j/query conn "SELECT * FROM invoices WHERE imported=true")))

View File

@@ -41,6 +41,12 @@
{:status 200
:body (pr-str (invoices/get-pending))
:headers {"Content-Type" "application/edn"}})
(POST "/api/invoices/reject" []
(invoices/reject)
(println (invoices/get-pending))
{:status 200
:body (pr-str (invoices/get-pending))
:headers {"Content-Type" "application/edn"}})
(POST "/pdf-upload"
{{ files "file"} :params :as params}
(let [{:keys [filename tempfile]} files]
@@ -56,4 +62,4 @@
(route/not-found "Not Found"))
(def app
(wrap-edn-params (mp/wrap-multipart-params (wrap-reload app-routes))))
(wrap-edn-params (mp/wrap-multipart-params (wrap-reload #'app-routes))))