fix handling of mandatory required attribute on attribute

integration-tests
Josha von Gizycki 6 years ago
parent e1630fd848
commit cff4e1139b

@ -63,8 +63,7 @@
(defn edit! [attr] (defn edit! [attr]
(neo4j/exec-query! (neo4j/exec-query!
edit edit
(update attr attr))
:required #(if (some? %) 1 0))))
(neo4j/defquery delete-by-uuid (neo4j/defquery delete-by-uuid
"MATCH (a:attribute)-[c]-() "MATCH (a:attribute)-[c]-()

@ -12,8 +12,8 @@
(let [schema-uuid (get-in req [:params :schema])] (let [schema-uuid (get-in req [:params :schema])]
(if (form/valid? view-schema/attr-form req) (if (form/valid? view-schema/attr-form req)
(do (do
(domain/create-new! (merge {:required 0} (domain/create-new! (form/form-data view-schema/attr-form
(:params req)) req)
schema-uuid schema-uuid
(get-in req [:session :uuid])) (get-in req [:session :uuid]))
(resp/redirect (path :schema-show {:uuid schema-uuid}))) (resp/redirect (path :schema-show {:uuid schema-uuid})))
@ -22,7 +22,7 @@
(defn edit! [schema-uuid req] (defn edit! [schema-uuid req]
(if (form/valid? view-schema/attr-form req) (if (form/valid? view-schema/attr-form req)
(do (do
(domain/edit! (:params req)) (domain/edit! (form/form-data view-schema/attr-form req))
(resp/redirect (path :schema-show {:uuid schema-uuid}))) (resp/redirect (path :schema-show {:uuid schema-uuid})))
(routes-schema/view! schema-uuid req))) (routes-schema/view! schema-uuid req)))

Loading…
Cancel
Save