mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
enhance(apis): add reset option to upsertBlockProperty for block properties
This commit is contained in:
@@ -834,7 +834,10 @@ export interface IEditorProxy extends Record<string, any> {
|
||||
upsertBlockProperty: (
|
||||
block: BlockIdentity | EntityID,
|
||||
key: string,
|
||||
value: any
|
||||
value: any,
|
||||
options?: Partial<{
|
||||
reset: boolean
|
||||
}>
|
||||
) => Promise<void>
|
||||
|
||||
removeBlockProperty: (block: BlockIdentity | EntityID, key: string) => Promise<void>
|
||||
|
||||
@@ -419,7 +419,10 @@
|
||||
(p/let [key' (api-block/sanitize-user-property-name key)
|
||||
opts (bean/->clj options)
|
||||
block (<get-block id {:children? false})
|
||||
value (bean/->clj value)]
|
||||
value (bean/->clj value)
|
||||
opts (cond-> opts
|
||||
(boolean? (:reset opts))
|
||||
(assoc :reset-property-values (:reset opts)))]
|
||||
(when block
|
||||
(db-based-api/upsert-block-property this block key' value opts)))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user