Skip to content
Snippets Groups Projects
Commit f9b724e7 authored by Tom Robinson's avatar Tom Robinson
Browse files

Test pulse endpoint

parent a478a319
Branches
Tags
No related merge requests found
......@@ -11,7 +11,9 @@
[database :refer [Database]]
[pulse :refer [Pulse] :as pulse]
[pulse-channel :refer [channel-types]])
[metabase.pulse :as p]))
[metabase.pulse :as p]
[metabase.task.send-pulses :refer [send-pulse]]
[metabase.models.pulse :refer [retrieve-pulse]]))
(defendpoint GET "/"
......@@ -105,4 +107,12 @@
ba (p/render-pulse-card-to-png card data true)]
{:status 200 :headers {"Content-Type" "image/png"} :body (new java.io.ByteArrayInputStream ba) })))
;; Using "GET" for now so it's easier to trigger from the browser. Switch to using POST if we add a button in the UI.
(defendpoint GET "/:id/test"
"Test send a pulse"
[id]
(check-superuser)
(send-pulse (retrieve-pulse id))
{:status 200 :body {:ok true}})
(define-routes)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment