ability to approve

This commit is contained in:
Bryce Covert
2017-12-09 08:26:52 -08:00
parent 36cac4a023
commit bc6db905a5
6 changed files with 59 additions and 4 deletions

View File

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

View File

@@ -35,6 +35,12 @@
{:status 200
:body (pr-str (invoices/get-all))
:headers {"Content-Type" "application/edn"}})
(POST "/api/invoices/approve" []
(invoices/approve)
(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]