refactor: DRY up spread out definition of db's

namespace/parent feature. Following up to #11517, provide vars
so it's clear how a feature is used and coupled throughout the codebase
This commit is contained in:
Gabriel Horner
2024-09-23 14:16:52 -04:00
parent 8542e6d8d9
commit afe4280c6a
11 changed files with 48 additions and 27 deletions

View File

@@ -37,7 +37,8 @@
[frontend.util.text :as text-util]
[goog.userAgent]
[frontend.db.async :as db-async]
[logseq.db :as ldb]))
[logseq.db :as ldb]
[logseq.common.util.namespace :as ns-util]))
(defn translate [t {:keys [id desc]}]
(when id
@@ -106,7 +107,7 @@
(take 5 items))))
node-exists? (let [blocks-result (keep :source-block (get-in results [:nodes :items]))]
(when-not (string/blank? input)
(or (some-> (last (string/split input "/"))
(or (some-> (last (string/split input ns-util/parent-char))
string/trim
db/get-page)
(some (fn [block]