integration-tests
Josha von Gizycki 6 years ago
commit 31b18dec40

@ -2,7 +2,7 @@
(:require [compojure.core :refer [defroutes GET POST]]
[ring.util.response :as resp]
[wanijo.framework.form :as form]
[wanijo.framework.routing :refer [register path]]
[wanijo.framework.routing :refer [register! path]]
[wanijo.attribute.domain :as domain]
[wanijo.schema.view :as view-schema]
[wanijo.schema.domain :as domain-schema]))
@ -22,7 +22,7 @@
(domain/find-by-schema! schema-uuid)
req))))
(register :attribute-new "/attribute/new")
(defroutes routes
(POST "/attribute/new" [] new!))
(POST (register! :attribute-new "/attribute/new")
[]
new!))

@ -17,12 +17,6 @@
(resp/redirect "/schema"))
(view-schema/overview! req)))
(defn show-schema! [uuid req]
(view-schema/show-schema!
(domain/find-by-uuid! uuid)
(attr-domain/find-by-schema! uuid)
req))
(defn delete-schema! [uuid session]
(if (domain/can-user-modify? uuid (:uuid session))
(do
@ -36,7 +30,10 @@
view-schema/overview!)
(GET (register! :schema-show "/schema/:uuid")
[uuid :as req]
(show-schema! uuid req))
(view-schema/show-schema!
(domain/find-by-uuid! uuid)
(attr-domain/find-by-schema! uuid)
req))
(POST (register! :schema-new "/schema/new")
[]
new!)

@ -1,16 +1,17 @@
(ns wanijo.user.routes
(:require [compojure.core :refer [defroutes GET POST]]
[ring.util.response :as resp]
[wanijo.framework.routing :refer [register]]
[wanijo.framework.routing :refer [register!]]
[wanijo.user.view :as view-user]
[wanijo.user.domain :as domain]))
(register :user-profile "/user/profile")
(register :user-edit "/user/edit")
(defn profile! [req]
(view-user/profile! req
(domain/find! (get-in req [:session :ident]))))
(defroutes routes
(GET "/user/profile" [] profile!))
(GET
(register! :user-profile "/user/profile")
[:as req]
(view-user/profile!
req
(domain/find! (get-in req [:session :ident]))))
(POST (register! :user-edit "/user/edit")
[]
(fn [req])))

Loading…
Cancel
Save