|
|
@ -6,7 +6,7 @@
|
|
|
|
[wanijo.schema.domain :as domain]
|
|
|
|
[wanijo.schema.domain :as domain]
|
|
|
|
[wanijo.schema.view :as view-schema]))
|
|
|
|
[wanijo.schema.view :as view-schema]))
|
|
|
|
|
|
|
|
|
|
|
|
(defn- new! [req]
|
|
|
|
(defn new! [req]
|
|
|
|
(if (form/valid? view-schema/new-form req)
|
|
|
|
(if (form/valid? view-schema/new-form req)
|
|
|
|
(do
|
|
|
|
(do
|
|
|
|
(domain/create-new!
|
|
|
|
(domain/create-new!
|
|
|
@ -15,6 +15,13 @@
|
|
|
|
(resp/redirect "/schema"))
|
|
|
|
(resp/redirect "/schema"))
|
|
|
|
(view-schema/overview! req)))
|
|
|
|
(view-schema/overview! req)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn show-schema! [uuid session]
|
|
|
|
|
|
|
|
(println uuid session)
|
|
|
|
|
|
|
|
(view-schema/show-schema!
|
|
|
|
|
|
|
|
(domain/find-by-uuid! uuid)
|
|
|
|
|
|
|
|
session))
|
|
|
|
|
|
|
|
|
|
|
|
(defroutes schema-routes
|
|
|
|
(defroutes schema-routes
|
|
|
|
(GET "/schema" [] view-schema/overview!)
|
|
|
|
(GET "/schema" [] view-schema/overview!)
|
|
|
|
|
|
|
|
(GET "/schema/:uuid" [uuid :as req] (show-schema! uuid (:session req)))
|
|
|
|
(POST "/schema/new" [] new!))
|
|
|
|
(POST "/schema/new" [] new!))
|
|
|
|