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

move GET '/' definition to top of the file.

parent ac3c1843
Branches
Tags
No related merge requests found
......@@ -11,6 +11,15 @@
[table :refer [Table]])
[metabase.util :as u]))
(defendpoint GET "/" [org]
(require-params org)
(let [db-ids (->> (sel :many [Database :id] :organization_id org)
(map :id))]
(-> (sel :many Table :db_id [in db-ids] (order :name :ASC))
(simple-batched-hydrate Database :db_id :db))))
(defendpoint GET "/:id" [id]
(->404 (sel :one Table :id id)
(hydrate :db :pk_field)))
......@@ -28,11 +37,5 @@
(->404 (sel :one Table :id id)
(hydrate :db :fields)))
(defendpoint GET "/" [org]
(require-params org)
(let [db-ids (->> (sel :many [Database :id] :organization_id org)
(map :id))]
(-> (sel :many Table :db_id [in db-ids] (order :name :ASC))
(simple-batched-hydrate Database :db_id :db))))
(define-routes)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment