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