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

add :pk_field back onto the GET /api/meta/table/:id response

parent d7b472c1
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@
(defendpoint GET "/:id" [id]
(->404 (sel :one Table :id id)
(hydrate :db)))
(hydrate :db :pk_field)))
(defendpoint PUT "/:id" [id :as {body :body}]
(write-check Table id)
......
......@@ -14,6 +14,7 @@
:db (or db (delay (sel :one db/Database :id db_id))) ; Check to see if `:db` is already set. In some cases we add a korma transform fn to `Table`
:fields (delay (sel :many Field :table_id id)) ; and assoc :db if the DB has already been fetched, so we can re-use its DB connections.
:description (u/jdbc-clob->str description)
:pk_field (delay (:id (sel :one :fields [Field :id] :table_id id (where {:special_type "id"}))))
:can_read (delay @(:can_read @(:db <>)))
:can_write (delay @(:can_write @(:db <>)))))
......
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