ability to approve
This commit is contained in:
@@ -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")))
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user