cleanup old uses of :id property

they should only run on file graphs
This commit is contained in:
Gabriel Horner
2023-10-18 14:05:21 -04:00
parent 9464d477cc
commit 91b3be3cfb
2 changed files with 8 additions and 10 deletions

View File

@@ -315,7 +315,8 @@
repo (or repo (state/get-current-repo))
format (or format (state/get-preferred-format))
page (db/entity repo (:db/id page))
block-id (when (map? properties) (get properties :id))
block-id (when (and (not (config/db-based-graph? repo)) (map? properties))
(get properties :id))
content (-> (file-property/remove-built-in-properties-when-file-based repo format content)
(drawer/remove-logbook))]
(cond

View File

@@ -137,15 +137,12 @@
[txs opts before-editor-cursor]
(let [repo (state/get-current-repo)
db-based? (config/db-based-graph? repo)
txs (map (fn [m] (if (map? m)
(cond-> m
true
(dissoc :block/children :block/meta :block/top? :block/bottom? :block/anchor
:block/title :block/body :block/level :block/container :db/other-tx
:block/unordered)
db-based?
(update :block/properties dissoc :id))
m)) txs)
txs (map (fn [m]
(if (map? m)
(dissoc m :block/children :block/meta :block/top? :block/bottom? :block/anchor
:block/title :block/body :block/level :block/container :db/other-tx
:block/unordered)
m)) txs)
txs (remove-nil-from-transaction txs)
txs (cond-> txs
(:uuid-changed opts)