fix: only add schema to property when it exists

This ensures that we can always validate schema as having a
:type which is important for a property's validity
This commit is contained in:
Gabriel Horner
2023-10-25 09:42:31 -04:00
parent 8a20c1c91b
commit 1d90663fb0

View File

@@ -75,10 +75,11 @@
{:outliner-op :save-block}))
(when (nil? property) ;if property not exists yet
(db/transact! repo [(sqlite-util/build-new-property
{:block/schema schema
:block/original-name k-name
:block/name (util/page-name-sanity-lc k-name)
:block/uuid property-uuid})]
(cond-> {:block/original-name k-name
:block/name (util/page-name-sanity-lc k-name)
:block/uuid property-uuid}
(seq schema)
(assoc :block/schema schema)))]
{:outliner-op :insert-blocks}))))
(defn- reset-block-property-multiple-values!