Move set-block-properties! to property handler

experiment/tanstack-table
Tienson Qin 2024-06-13 14:37:12 +08:00
parent 452b79d350
commit 71584905a7
2 changed files with 7 additions and 2 deletions

View File

@ -23,7 +23,6 @@
[frontend.handler.common :as common-handler] [frontend.handler.common :as common-handler]
[frontend.handler.db-based.editor :as db-editor-handler] [frontend.handler.db-based.editor :as db-editor-handler]
[frontend.handler.db-based.property.util :as db-pu] [frontend.handler.db-based.property.util :as db-pu]
[frontend.handler.db-based.property :as db-property-handler]
[frontend.handler.export.html :as export-html] [frontend.handler.export.html :as export-html]
[frontend.handler.export.text :as export-text] [frontend.handler.export.text :as export-text]
[frontend.handler.file-based.editor :as file-editor-handler] [frontend.handler.file-based.editor :as file-editor-handler]
@ -586,7 +585,7 @@
:ordered-list? ordered-list? :ordered-list? ordered-list?
:replace-empty-target? replace-empty-target?}) :replace-empty-target? replace-empty-target?})
(when (and db-base? (seq properties)) (when (and db-base? (seq properties))
(db-property-handler/set-block-properties! (:block/uuid new-block) properties))) (property-handler/set-block-properties! repo (:block/uuid new-block) properties)))
(when edit-block? (when edit-block?
(if (and replace-empty-target? (if (and replace-empty-target?
(string/blank? (:block/content last-block))) (string/blank? (:block/content last-block)))

View File

@ -55,3 +55,9 @@
(db-property-handler/batch-remove-property! block-ids key) (db-property-handler/batch-remove-property! block-ids key)
(db-property-handler/batch-set-property! block-ids key value)) (db-property-handler/batch-set-property! block-ids key value))
(file-property-handler/batch-set-block-property! block-ids key value))) (file-property-handler/batch-set-block-property! block-ids key value)))
(defn set-block-properties!
[repo block-id properties]
(assert (uuid? block-id))
(when (config/db-based-graph? repo)
(db-property-handler/set-block-properties! block-id properties)))