Makes browsing work rigth

This commit is contained in:
Bryce
2024-03-20 15:47:00 -07:00
parent 8af5713ba2
commit 0cdf908acd
7 changed files with 92 additions and 46 deletions

View File

@@ -104,14 +104,21 @@
match->handler))
(defn wrap-guess-route [handler]
(fn [{:keys [uri request-method] :as request}]
(fn [{:keys [uri request-method headers] :as request}]
(let [matched-route (:handler
(bidi.bidi/match-route all-routes
uri
:request-method request-method))]
:request-method request-method))
matched-hx-current-url-route (some->> (get headers "hx-current-url")
url/url
:path
(bidi/match-route ssr-routes/only-routes)
:handler)]
(handler (assoc request
:matched-route
matched-route)))))
matched-route
:matched-current-page-route
matched-hx-current-url-route)))))
(defn test-match-route [method uri]
(bidi.bidi/match-route all-routes