enhance: allow query function to fallback to named properties with :result-transform

pull/10438/head
Gabriel Horner 2023-09-22 10:32:56 -04:00
parent 358987d7b3
commit 19be2850ff
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@
int? (some integer? vals)
repo (state/get-current-repo)
prop-key (if (config/db-based-graph? repo)
(:block/uuid (db/entity repo [:block/name (gp-util/page-name-sanity-lc (name f))]))
(or (:block/uuid (db/entity repo [:block/name (gp-util/page-name-sanity-lc (name f))]))
;; Fall back to the keyword for queries that set named properties through :result-transform
f)
f)]
`(~'fn [~'b]
(~'let [~'result-str (~'get-in ~'b [:block/properties ~prop-key])