From 2ccb94a944cdd9430fcd8f2bd0c6630b7975dbd3 Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Wed, 29 Aug 2018 19:50:11 +0200 Subject: [PATCH] more migration to new routing function --- src/wanijo/attribute/routes.clj | 8 ++++---- src/wanijo/user/routes.clj | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/wanijo/attribute/routes.clj b/src/wanijo/attribute/routes.clj index 99c0cc6..8d78eb5 100644 --- a/src/wanijo/attribute/routes.clj +++ b/src/wanijo/attribute/routes.clj @@ -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])) @@ -23,7 +23,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!)) diff --git a/src/wanijo/user/routes.clj b/src/wanijo/user/routes.clj index b9b4cd9..9628916 100644 --- a/src/wanijo/user/routes.clj +++ b/src/wanijo/user/routes.clj @@ -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])))