From e0e5b75fac0cdd11b0fb335a7672da9d23d1a344 Mon Sep 17 00:00:00 2001 From: Dmitri Sotnikov Date: Wed, 31 Jan 2024 18:51:59 +0000 Subject: [PATCH] Circle #276 --- docs/docs/integrant.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/docs/integrant.html b/docs/docs/integrant.html index 41eddc8..23dc150 100644 --- a/docs/docs/integrant.html +++ b/docs/docs/integrant.html @@ -115,10 +115,9 @@

Contents

(layout/init-selmer!) [base-path (route-data opts) (page-routes opts)])

The multimethod attaches the opts to the request map by calling (route-data opts), and the request handle function can now access the :query-fn key from the request map by calling (utils/route-data request) as follows:


-(defn home [{:keys [flash] :as request}]
-  (let [{:keys [query-fn]} (utils/route-data request)]
-    (layout/render request "home.html" {:messages (query-fn :get-messages {})
-                                        :errors (:errors flash)})))
+(defn home [{:keys [query-fn]} {:keys [flash] :as request}]
+  (layout/render request "home.html" {:messages (query-fn :get-messages {})
+                                      :errors (:errors flash)}))