mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
enhance(api): managing property choice values
This commit is contained in:
@@ -793,6 +793,7 @@ export interface IEditorProxy extends Record<string, any> {
|
||||
* */
|
||||
setBlockIcon: (blockId: BlockIdentity, iconType: 'tabler-icon' | 'emoji', iconName: string) => Promise<void>
|
||||
removeBlockIcon: (blockId: BlockIdentity) => Promise<void>
|
||||
addPropertyValueChoices: (propertyId: BlockIdentity, choices: Array<BlockIdentity>) => Promise<void>
|
||||
|
||||
prependBlockInPage: (
|
||||
page: PageIdentity,
|
||||
|
||||
@@ -214,6 +214,7 @@
|
||||
(def ^:export remove_tag_property db-based-api/tag-remove-property)
|
||||
(def ^:export set_block_icon db-based-api/set-block-icon)
|
||||
(def ^:export remove_block_icon db-based-api/remove-block-icon)
|
||||
(def ^:export add_property_value_choices db-based-api/add-property-value-choices)
|
||||
|
||||
;; Internal db-based CLI APIs
|
||||
;; CLI APIs should use ensure-db-graph unless they have a nested check in cli-common-mcp-tools ns
|
||||
|
||||
@@ -381,3 +381,8 @@
|
||||
block (db-async/<get-block repo block-id)]
|
||||
(db-property-handler/remove-block-property! (:block/uuid block)
|
||||
:logseq.property/icon)))
|
||||
|
||||
(defn add-property-value-choices [property-id ^js choices]
|
||||
(when-let [values (and property-id (bean/->clj choices))]
|
||||
(db-property-handler/add-existing-values-to-closed-values!
|
||||
property-id values)))
|
||||
Reference in New Issue
Block a user