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

Merge pull request #299 from metabase/ag-db-list-inherits

update database listing endpoint to account of org.inherits
parents f1ca075d 72f7d5ed
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,12 @@
"Fetch all `Databases` for an `Org`."
[org]
{org Required}
(read-check Org org)
(-> (sel :many Database :organization_id org (order :name))
(hydrate :organization)))
(let-404 [{:keys [id inherits] :as org} (sel :one Org :id org)]
(read-check org)
(-> (sel :many Database (order :name) (where (if inherits
{}
{:organization_id id})))
(hydrate :organization))))
(defendpoint POST "/"
"Add a new `Database` for `Org`."
......
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