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

more concise way to write our query.

parent 97b83689
No related branches found
No related tags found
No related merge requests found
......@@ -26,12 +26,9 @@
{org Required}
(let-404 [{:keys [id inherits] :as org} (sel :one Org :id org)]
(read-check org)
(-> (if inherits
;; orgs which `inherit` get access to ALL databases
(sel :many Database (order :name))
;; otherwise we filter to just databases attached to the org
(sel :many Database :organization_id id (order :name)))
(hydrate :organization))))
(-> (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