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]
(neo4j/exec-query!
edit
(update attr
:required #(if (some? %) 1 0))))
attr))
(neo4j/defquery delete-by-uuid
"MATCH (a:attribute)-[c]-()

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

Loading…
Cancel
Save