|
|
@ -5,7 +5,8 @@
|
|
|
|
[wanijo.framework.routing :refer [register! path]]
|
|
|
|
[wanijo.framework.routing :refer [register! path]]
|
|
|
|
[wanijo.attribute.domain :as domain]
|
|
|
|
[wanijo.attribute.domain :as domain]
|
|
|
|
[wanijo.schema.view :as view-schema]
|
|
|
|
[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]
|
|
|
|
(defn new! [req]
|
|
|
|
(let [schema-uuid (get-in req [:params :schema])]
|
|
|
|
(let [schema-uuid (get-in req [:params :schema])]
|
|
|
@ -16,20 +17,14 @@
|
|
|
|
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})))
|
|
|
|
(view-schema/show-schema!
|
|
|
|
(routes-schema/view! schema-uuid req))))
|
|
|
|
(domain-schema/find-by-uuid! schema-uuid)
|
|
|
|
|
|
|
|
(domain/find-by-schema! schema-uuid)
|
|
|
|
|
|
|
|
req))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(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! (:params req))
|
|
|
|
(resp/redirect (path :schema-show {:uuid schema-uuid})))
|
|
|
|
(resp/redirect (path :schema-show {:uuid schema-uuid})))
|
|
|
|
(view-schema/show-schema!
|
|
|
|
(routes-schema/view! schema-uuid req)))
|
|
|
|
(domain-schema/find-by-uuid! schema-uuid)
|
|
|
|
|
|
|
|
(domain/find-by-schema! schema-uuid)
|
|
|
|
|
|
|
|
req)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn delete! [uuid req]
|
|
|
|
(defn delete! [uuid req]
|
|
|
|
(domain/delete-by-uuid! uuid)
|
|
|
|
(domain/delete-by-uuid! uuid)
|
|
|
|