mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix(api): incorrect property type key
This commit is contained in:
@@ -215,7 +215,7 @@ test('(DB graph): block related apis',
|
||||
prop1 = await callAPI('get_property', 'map1')
|
||||
const b1p = await callAPI('get_block_property', b1.uuid, 'map1')
|
||||
|
||||
expect(prop1.schema.type).toBe('map')
|
||||
expect(prop1.type).toBe('map')
|
||||
expect(b1p).toEqual({a: 1})
|
||||
|
||||
// await page.pause()
|
||||
|
||||
@@ -903,7 +903,10 @@
|
||||
[k]
|
||||
(this-as this
|
||||
(p/let [prop (-get-property this k)]
|
||||
(bean/->js (sdk-utils/normalize-keyword-for-json prop)))))
|
||||
(-> prop
|
||||
(assoc :type (:logseq.property/type prop))
|
||||
(sdk-utils/normalize-keyword-for-json)
|
||||
(bean/->js)))))
|
||||
|
||||
(defn ^:export upsert_property
|
||||
"schema:
|
||||
@@ -929,7 +932,8 @@
|
||||
(string? (:cardinality schema))
|
||||
(update :cardinality keyword)
|
||||
(string? (:type schema))
|
||||
(update :type keyword))
|
||||
(-> (assoc :logseq.property/type (keyword (:type schema)))
|
||||
(dissoc :type)))
|
||||
p (db-property-handler/upsert-property! k schema
|
||||
(cond-> opts
|
||||
name
|
||||
|
||||
Reference in New Issue
Block a user