fix error when editing multiple properties, preparations for tags

integration-tests
Josha von Gizycki 5 years ago
parent e0754d3d38
commit bcaa65e799

@ -103,7 +103,9 @@
(defn edit! [instance] (defn edit! [instance]
(let [prop-tuples (map #(vector edit-property (let [prop-tuples (map #(vector edit-property
{:uuid (:uuid % (neo4j/uuid)) {:uuid (if (empty? (:uuid %))
(neo4j/uuid)
(:uuid %))
:now (neo4j/now-str) :now (neo4j/now-str)
:value (:value %) :value (:value %)
:instance_uuid (:uuid instance) :instance_uuid (:uuid instance)
@ -190,6 +192,15 @@
(neo4j/exec-query! delete-link (neo4j/exec-query! delete-link
{:uuid uuid})) {:uuid uuid}))
(neo4j/defquery tags
"MATCH (i:instance {uuid:{uuid}})-[:has]->(t:tag)
RETURN t
ORDER BY t.name")
(defn tags! [uuid]
(neo4j/exec-query! tags
{:uuid uuid}))
(defn full-instance-by-uuid! [uuid] (defn full-instance-by-uuid! [uuid]
(assoc (find-by-uuid! uuid) (assoc (find-by-uuid! uuid)
:properties :properties
@ -197,7 +208,9 @@
:links-out :links-out
(outgoing-links! uuid) (outgoing-links! uuid)
:links-in :links-in
(incoming-links! uuid))) (incoming-links! uuid)
:tags
(tags! uuid)))
(neo4j/defquery is-starred (neo4j/defquery is-starred
"MATCH (u:user {uuid:{user_uuid}}), "MATCH (u:user {uuid:{user_uuid}}),

Loading…
Cancel
Save