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

flushed out implementation of email report executions listing endpoint.

parent 4eb01455
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,8 @@
;; TODO - implementation (list recent results of a query)
(let-404 [{:keys [can_read] :as report} (sel :one EmailReport :id id)]
(check-403 @can_read)
(sel :many EmailReportExecutions :report_id id (order :finished_at :DESC) (limit 10))))
(-> (sel :many EmailReportExecutions :report_id id (order :created_at :DESC) (limit 25))
(hydrate :organization))))
(define-routes)
(ns metabase.models.emailreport-executions
(:use korma.core))
(:require [clojure.data.json :as json]
[korma.core :refer :all]
[metabase.api.common :refer [check]]
[metabase.db :refer :all]
(metabase.models [common :refer [assoc-permissions-sets perms-none]]
[hydrate :refer [realize-json]]
[emailreport-recipients :refer [EmailReportRecipients]]
[org :refer [Org org-can-read org-can-write]]
[user :refer [User]])
[metabase.util :as util]))
(defentity EmailReportExecutions
(table :report_emailreportexecutions))
(defmethod post-select EmailReportExecutions [_ {:keys [organization_id] :as execution}]
(-> execution
(realize-json :details)
(util/assoc*
:organization (delay
(sel :one Org :id organization_id)))))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment