From 20b9d3c6c876749b9c19448b015532159b7456d6 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Thu, 1 Feb 2018 16:25:04 +0200 Subject: [PATCH] :parts => :path-parts --- modules/reitit-core/src/reitit/core.cljc | 2 +- modules/reitit-core/src/reitit/impl.cljc | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/reitit-core/src/reitit/core.cljc b/modules/reitit-core/src/reitit/core.cljc index 3a1cc9e3..535353f4 100644 --- a/modules/reitit-core/src/reitit/core.cljc +++ b/modules/reitit-core/src/reitit/core.cljc @@ -100,7 +100,7 @@ (into [] (keep #(compile-route % opts) routes))) (defn route-info [route] - (select-keys (impl/create route) [:path :parts :path-params :result :data])) + (select-keys (impl/create route) [:path :path-parts :path-params :result :data])) (defprotocol Router (router-name [this]) diff --git a/modules/reitit-core/src/reitit/impl.cljc b/modules/reitit-core/src/reitit/impl.cljc index 142006ed..46d5a3b7 100644 --- a/modules/reitit-core/src/reitit/impl.cljc +++ b/modules/reitit-core/src/reitit/impl.cljc @@ -96,7 +96,7 @@ ;; Routing (c) Metosin ;; -(defrecord Route [path matcher parts path-params data result]) +(defrecord Route [path matcher path-parts path-params data result]) (defn create [[path data result]] (let [path #?(:clj (.intern ^String path) :cljs path)] @@ -110,7 +110,6 @@ :data data}) (dissoc $ :path-re :path-constraints) (update $ :path-params set) - (set/rename-keys $ {:path-parts :parts}) (map->Route $)))) (defn wild-route? [[path]] @@ -130,7 +129,7 @@ (defn path-for [^Route route path-params] (if-let [required (:path-params route)] (if (every? #(contains? path-params %) required) - (str "/" (str/join \/ (map #(get (or path-params {}) % %) (:parts route))))) + (str "/" (str/join \/ (map #(get (or path-params {}) % %) (:path-parts route))))) (:path route))) (defn throw-on-missing-path-params [template required path-params]