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

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

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

@ -1,16 +1,17 @@
(ns wanijo.user.routes (ns wanijo.user.routes
(:require [compojure.core :refer [defroutes GET POST]] (:require [compojure.core :refer [defroutes GET POST]]
[ring.util.response :as resp] [ring.util.response :as resp]
[wanijo.framework.routing :refer [register]] [wanijo.framework.routing :refer [register!]]
[wanijo.user.view :as view-user] [wanijo.user.view :as view-user]
[wanijo.user.domain :as domain])) [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 (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