mirror of
https://github.com/metosin/reitit.git
synced 2026-02-08 21:03:11 +00:00
Format code
This commit is contained in:
parent
7f1b2ce417
commit
434bc25cd6
1 changed files with 8 additions and 2 deletions
|
|
@ -131,7 +131,10 @@
|
||||||
(defn path-for [^Route route path-params]
|
(defn path-for [^Route route path-params]
|
||||||
(if-let [required (:path-params route)]
|
(if-let [required (:path-params route)]
|
||||||
(if (every? #(contains? path-params %) required)
|
(if (every? #(contains? path-params %) required)
|
||||||
(str "/" (str/join \/ (map #(get (or path-params {}) % %) (:path-parts route)))))
|
(->> (:path-parts route)
|
||||||
|
(map #(get (or path-params {}) % %))
|
||||||
|
(str/join \/)
|
||||||
|
(str "/")))
|
||||||
(:path route)))
|
(:path route)))
|
||||||
|
|
||||||
(defn throw-on-missing-path-params [template required path-params]
|
(defn throw-on-missing-path-params [template required path-params]
|
||||||
|
|
@ -214,5 +217,8 @@
|
||||||
"shallow transform of query parameters into query string"
|
"shallow transform of query parameters into query string"
|
||||||
[params]
|
[params]
|
||||||
(->> params
|
(->> params
|
||||||
(map (fn [[k v]] (str (url-encode (into-string k)) "=" (url-encode (into-string v)))))
|
(map (fn [[k v]]
|
||||||
|
(str (url-encode (into-string k))
|
||||||
|
"="
|
||||||
|
(url-encode (into-string v)))))
|
||||||
(str/join "&")))
|
(str/join "&")))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue