fix(rtc): db/retract when :type/link/schema/properties is nil

pull/11049/head
rcmerci 2024-02-21 20:57:21 +08:00
parent 3ab33ff831
commit b892c9abe9
1 changed files with 8 additions and 0 deletions

View File

@ -314,6 +314,14 @@
(swap! *other-tx-data conj [:db/retract db-id :block/alias]))
(when (contains? key-set :tags)
(swap! *other-tx-data conj [:db/retract db-id :block/tags]))
(when (contains? key-set :type)
(swap! *other-tx-data conj [:db/retract db-id :block/type]))
(when (and (contains? key-set :link) (nil? (:link op-value)))
(swap! *other-tx-data conj [:db/retract db-id :block/link]))
(when (and (contains? key-set :schema) (nil? (:schema op-value)))
(swap! *other-tx-data conj [:db/retract db-id :block/schema]))
(when (and (contains? key-set :properties) (nil? (:properties op-value)))
(swap! *other-tx-data conj [:db/retract db-id :block/properties]))
(when (seq @*other-tx-data)
(ldb/transact! conn @*other-tx-data {:persist-op? false}))
(transact-db! :save-block repo conn date-formatter new-block)))))))