unpaid and paid invoices use the same underlying page, now.

This commit is contained in:
Bryce Covert
2019-01-25 22:47:20 -08:00
parent b401ca9c7b
commit 1d34dd157a
8 changed files with 108 additions and 181 deletions

View File

@@ -2,6 +2,7 @@
(:require [bidi.bidi :as bidi]
[pushy.core :as pushy]
[auto-ap.routes :as routes]
[cemerick.url :refer [url]]
[re-frame.core :as re-frame]))
(defn- parse-url [url]
@@ -10,7 +11,9 @@
(defn- dispatch-route [matched-route]
(println "Matched route" matched-route)
(re-frame/dispatch [:auto-ap.events/set-active-page (:handler matched-route)]))
(re-frame/dispatch [:auto-ap.events/set-active-page (:handler matched-route) (->> (:query (url (.-location js/window)))
(map (fn [[k v]] [(keyword k) v]))
(into {}))]))
(def history (pushy/pushy dispatch-route parse-url))