chore: merge 2 new property fns together

refactor possible since page-name-sanity-lc in common-util
This commit is contained in:
Gabriel Horner
2024-01-29 09:55:34 -05:00
parent 8f736e82c7
commit 28e637e855
5 changed files with 20 additions and 34 deletions

View File

@@ -176,13 +176,13 @@
:property-attributes
{:db/id (or (property-db-ids (name prop-name))
(throw (ex-info "No :db/id for property" {:property prop-name})))}})
[(sqlite-util/build-new-property
(merge (db-property-util/new-property-tx prop-name (get-in properties [prop-name :block/schema]) uuid)
{:db/id (or (property-db-ids (name prop-name))
(throw (ex-info "No :db/id for property" {:property prop-name})))}
(when-let [props (not-empty (get-in properties [prop-name :properties]))]
{:block/properties (->block-properties-tx props uuid-maps)
:block/refs (build-property-refs props property-db-ids)})))]))
[(merge
(sqlite-util/build-new-property prop-name (get-in properties [prop-name :block/schema]) uuid)
{:db/id (or (property-db-ids (name prop-name))
(throw (ex-info "No :db/id for property" {:property prop-name})))}
(when-let [props (not-empty (get-in properties [prop-name :properties]))]
{:block/properties (->block-properties-tx props uuid-maps)
:block/refs (build-property-refs props property-db-ids)}))]))
property-uuids))
pages-and-blocks-tx
(vec