Skip to content
Snippets Groups Projects
Commit 32f93e81 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

implement POST /api/emailreport/:id which executes a given email report.

parent e7cb828c
Branches
Tags
No related merge requests found
......@@ -12,6 +12,7 @@
[emailreport-executions :refer [EmailReportExecutions]]
[org :refer [Org]]
[user :refer [users-for-org]])
[metabase.tasks.email-report :as report]
[metabase.util :as util]))
(defannotation EmailReportFilterOption [symb value :nillable]
......@@ -100,9 +101,10 @@
(del EmailReport :id id))
;; TODO
;; (defendpoint POST "/:id" [id]
;; {:TODO "TODO"})
(defendpoint POST "/:id" [id]
(read-check EmailReport id)
(->> (report/execute-and-send id)
(sel :one EmailReportExecutions :id)))
(defendpoint GET "/:id/executions" [id]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment