|
|
|
@ -5,7 +5,8 @@
|
|
|
|
|
[wanijo.framework.routing :refer [register! path]]
|
|
|
|
|
[wanijo.attribute.domain :as domain]
|
|
|
|
|
[wanijo.schema.view :as view-schema]
|
|
|
|
|
[wanijo.schema.domain :as domain-schema]))
|
|
|
|
|
[wanijo.schema.domain :as domain-schema]
|
|
|
|
|
[wanijo.schema.routes :as routes-schema]))
|
|
|
|
|
|
|
|
|
|
(defn new! [req]
|
|
|
|
|
(let [schema-uuid (get-in req [:params :schema])]
|
|
|
|
@ -16,20 +17,14 @@
|
|
|
|
|
schema-uuid
|
|
|
|
|
(get-in req [:session :uuid]))
|
|
|
|
|
(resp/redirect (path :schema-show {:uuid schema-uuid})))
|
|
|
|
|
(view-schema/show-schema!
|
|
|
|
|
(domain-schema/find-by-uuid! schema-uuid)
|
|
|
|
|
(domain/find-by-schema! schema-uuid)
|
|
|
|
|
req))))
|
|
|
|
|
(routes-schema/view! schema-uuid req))))
|
|
|
|
|
|
|
|
|
|
(defn edit! [schema-uuid req]
|
|
|
|
|
(if (form/valid? view-schema/attr-form req)
|
|
|
|
|
(do
|
|
|
|
|
(domain/edit! (:params req))
|
|
|
|
|
(resp/redirect (path :schema-show {:uuid schema-uuid})))
|
|
|
|
|
(view-schema/show-schema!
|
|
|
|
|
(domain-schema/find-by-uuid! schema-uuid)
|
|
|
|
|
(domain/find-by-schema! schema-uuid)
|
|
|
|
|
req)))
|
|
|
|
|
(routes-schema/view! schema-uuid req)))
|
|
|
|
|
|
|
|
|
|
(defn delete! [uuid req]
|
|
|
|
|
(domain/delete-by-uuid! uuid)
|
|
|
|
|