Adding reminders view
This commit is contained in:
8
src/clj/auto_ap/db/reminders.clj
Normal file
8
src/clj/auto_ap/db/reminders.clj
Normal file
@@ -0,0 +1,8 @@
|
||||
(ns auto-ap.db.reminders
|
||||
(:require [clojure.java.jdbc :as j]
|
||||
[auto-ap.parse :as parse]
|
||||
[auto-ap.db.utils :refer [clj->db db->clj get-conn]]))
|
||||
|
||||
(defn get-all []
|
||||
(doto (map db->clj (j/query (get-conn) "SELECT reminders.*, vendors.name as vendor_name FROM reminders INNER join vendors on reminders.vendor_id = vendors.id"))
|
||||
println))
|
||||
@@ -1,6 +1,8 @@
|
||||
(ns auto-ap.routes.reminders
|
||||
(:require [compojure.core :refer [context GET POST defroutes]]
|
||||
(:require [compojure.core :refer [context GET POST defroutes wrap-routes]]
|
||||
[auto-ap.db.vendors :as vendors]
|
||||
[auto-ap.db.reminders :as reminders]
|
||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[amazonica.aws.simpleemail :as ses]
|
||||
))
|
||||
|
||||
@@ -18,4 +20,10 @@
|
||||
:text (str "Hello " name ",\r\nThis is a reminder to send this week's invoices to us. You can just reply to this email.\r\n - Integreat.")}})))
|
||||
{:status 200
|
||||
:body "{}"
|
||||
:headers {"Content-Type" "application/edn"}})))
|
||||
:headers {"Content-Type" "application/edn"}})
|
||||
|
||||
(wrap-routes (GET "/" {:keys [query-params]}
|
||||
{:status 200
|
||||
:body (pr-str (reminders/get-all))
|
||||
:headers {"Content-Type" "application/edn"}})
|
||||
wrap-secure)))
|
||||
|
||||
Reference in New Issue
Block a user