Skip to content
Snippets Groups Projects
Commit 6dce4a93 authored by Cam Saul's avatar Cam Saul
Browse files

more concise code :heart_eyes: :hear_no_evil:

parent 006c1387
Branches
Tags
No related merge requests found
......@@ -129,12 +129,9 @@
"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 :active true)
fields (-> (sel :many Field :table_id [in table_ids] :special_type "id")
(hydrate :table))]
(sort-by (fn [field]
(:name (:table field)))
fields)))
(let [table_ids (sel :many :id Table :db_id id :active true)]
(sort-by #(:name (:table %)) (-> (sel :many Field :table_id [in table_ids] :special_type "id")
(hydrate :table)))))
(defendpoint POST "/:id/sync"
"Update the metadata for this `Database`."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment