fix: block should save with selected tag

While selecting an existing tag, block were saving with a tag that had
characters cutoff from the end
e.g. Drug_Class -> Drug_C or Comment_Class -> Comment_Cl
This commit is contained in:
Gabriel Horner
2023-10-30 16:41:59 -04:00
parent dc44e672d4
commit 49069e1998

View File

@@ -219,7 +219,7 @@
q))
last-pattern (str "#" (when wrapped? page-ref/left-brackets) last-pattern)]
(when (config/db-based-graph? (state/get-current-repo))
(let [tag (string/trim q)
(let [tag (string/trim chosen)
edit-block (state/get-edit-block)]
(when (and (not (string/blank? tag)) (:block/uuid edit-block))
(let [tag-entity (db/entity [:block/name (util/page-name-sanity-lc tag)])]