Remove more :block/name lookup ref usage

This commit is contained in:
Tienson Qin
2024-04-03 02:11:16 +08:00
parent 50e3ef5157
commit 9df8918f94
47 changed files with 262 additions and 288 deletions

View File

@@ -84,9 +84,9 @@
[ref-blocks filters]
(if (empty? filters)
ref-blocks
(let [exclude-ids (->> (keep (fn [page] (:db/id (db/entity [:block/name (util/page-name-sanity-lc page)]))) (get filters false))
(let [exclude-ids (->> (keep (fn [page] (:db/id (db/get-page page))) (get filters false))
(set))
include-ids (->> (keep (fn [page] (:db/id (db/entity [:block/name (util/page-name-sanity-lc page)]))) (get filters true))
include-ids (->> (keep (fn [page] (:db/id (db/get-page page))) (get filters true))
(set))]
(cond->> ref-blocks
(seq exclude-ids)