|
|
@ -3,7 +3,7 @@
|
|
|
|
[ring.util.response :as resp]
|
|
|
|
[ring.util.response :as resp]
|
|
|
|
[wanijo.framework.view :as view]
|
|
|
|
[wanijo.framework.view :as view]
|
|
|
|
[wanijo.framework.form :as form]
|
|
|
|
[wanijo.framework.form :as form]
|
|
|
|
[wanijo.framework.routing :refer [register]]
|
|
|
|
[wanijo.framework.routing :refer [register!]]
|
|
|
|
[wanijo.schema.domain :as domain]
|
|
|
|
[wanijo.schema.domain :as domain]
|
|
|
|
[wanijo.schema.view :as view-schema]
|
|
|
|
[wanijo.schema.view :as view-schema]
|
|
|
|
[wanijo.attribute.domain :as attr-domain]))
|
|
|
|
[wanijo.attribute.domain :as attr-domain]))
|
|
|
@ -30,13 +30,16 @@
|
|
|
|
(resp/redirect "/schema"))
|
|
|
|
(resp/redirect "/schema"))
|
|
|
|
{:status 403}))
|
|
|
|
{:status 403}))
|
|
|
|
|
|
|
|
|
|
|
|
(register :schema-overview "/schema")
|
|
|
|
|
|
|
|
(register :schema-show "/schema/:uuid")
|
|
|
|
|
|
|
|
(register :schema-new "/schema/new")
|
|
|
|
|
|
|
|
(register :schema-delete "/schema/:uuid")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defroutes routes
|
|
|
|
(defroutes routes
|
|
|
|
(GET "/schema" [] view-schema/overview!)
|
|
|
|
(GET (register! :schema-overview "/schema")
|
|
|
|
(GET "/schema/:uuid" [uuid :as req] (show-schema! uuid req))
|
|
|
|
[]
|
|
|
|
(POST "/schema/new" [] new!)
|
|
|
|
view-schema/overview!)
|
|
|
|
(DELETE "/schema/:uuid" [uuid :as req] (delete-schema! uuid (:session req))))
|
|
|
|
(GET (register! :schema-show "/schema/:uuid")
|
|
|
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
|
|
|
(show-schema! uuid req))
|
|
|
|
|
|
|
|
(POST (register! :schema-new "/schema/new")
|
|
|
|
|
|
|
|
[]
|
|
|
|
|
|
|
|
new!)
|
|
|
|
|
|
|
|
(DELETE (register! :schema-delete "/schema/:uuid")
|
|
|
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
|
|
|
(delete-schema! uuid (:session req))))
|
|
|
|