mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 05:04:24 +00:00
fix(apis): refine schema handling for property visibility and type
This commit is contained in:
@@ -132,7 +132,7 @@
|
||||
property-ident (api-block/get-db-ident-from-property-name k' this)
|
||||
_ (api-block/ensure-property-upsert-control this property-ident k')
|
||||
schema (or (some-> schema
|
||||
(update-keys #(if (contains? #{:hide :public} %)
|
||||
(update-keys #(if (contains? #{:public} %)
|
||||
(keyword (str (name %) "?")) %)))
|
||||
{})
|
||||
_ (when (:type schema)
|
||||
@@ -140,11 +140,15 @@
|
||||
schema (cond-> schema
|
||||
(string? (:cardinality schema))
|
||||
(-> (assoc :db/cardinality (->cardinality (:cardinality schema)))
|
||||
(dissoc :cardinality))
|
||||
(dissoc :cardinality))
|
||||
|
||||
(boolean? (:hide schema))
|
||||
(-> (assoc :logseq.property/hide? (:hide schema))
|
||||
(dissoc :hide))
|
||||
|
||||
(string? (:type schema))
|
||||
(-> (assoc :logseq.property/type (keyword (:type schema)))
|
||||
(dissoc :type)))
|
||||
(dissoc :type)))
|
||||
p (db-property-handler/upsert-property! property-ident schema
|
||||
(assoc opts :property-name k'))]
|
||||
(db/entity (:db/id p))))
|
||||
|
||||
Reference in New Issue
Block a user