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

Merge pull request #328 from metabase/ag-hide-disabled-things

hide disabled things
parents 22911f49 320f1728
Branches
Tags
No related merge requests found
......@@ -113,13 +113,13 @@
"Get a list of all `Tables` in `Database`."
[id]
(read-check Database id)
(sel :many Table :db_id id (order :name)))
(sel :many Table :db_id id :active true (order :name)))
(defendpoint GET "/:id/idfields"
"Get a list of all primary key `Fields` for `Database`."
[id]
(read-check Database id)
(let [table_ids (sel :many :id Table :db_id id)]
(let [table_ids (sel :many :id Table :db_id id :active true)]
(-> (sel :many Field :table_id [in table_ids] :special_type "id")
(hydrate :table))))
......
......@@ -23,7 +23,7 @@
{org Required}
(read-check Org org)
(let [db-ids (sel :many :id Database :organization_id org)]
(-> (sel :many Table :db_id [in db-ids] (order :name :ASC))
(-> (sel :many Table :active true :db_id [in db-ids] (order :name :ASC))
(hydrate :db))))
......@@ -49,7 +49,7 @@
"Get all `Fields` for `Table` with ID."
[id]
(read-check Table id)
(sel :many Field :table_id id (order :name :ASC)))
(sel :many Field :table_id id :active true (order :name :ASC)))
(defendpoint GET "/:id/query_metadata" [id]
(->404 (sel :one Table :id id)
......@@ -60,7 +60,7 @@
"Get all `ForeignKeys` whose destination is a `Field` that belongs to this `Table`."
[id]
(read-check Table id)
(let-404 [field-ids (sel :many :id Field :table_id id)]
(let-404 [field-ids (sel :many :id Field :table_id id :active true)]
(-> (sel :many ForeignKey :destination_id [in field-ids])
;; TODO - it's a little silly to hydrate both of these table objects
(hydrate [:origin [:table :db]] [:destination :table]))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment