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

@@ -7,6 +7,7 @@
[auto-ap.utils :refer [by]]
[venia.core :as v]
[bidi.bidi :as bidi]
[cemerick.url :refer [url]]
[goog.crypt.base64 :as b64]
[clojure.string :as str]))
@@ -33,6 +34,9 @@
:else
{:db (assoc db/default-db
:active-page handler
:query-params (->> (:query (url (.-location js/window)))
(map (fn [[k v]] [(keyword k) v]))
(into {}))
:user token)
:graphql {:token token
:query-obj {:venia/queries [[:client
@@ -106,11 +110,13 @@
(re-frame/reg-event-fx
::set-active-page
(fn [{:keys [db]} [_ handler]]
(fn [{:keys [db]} [_ handler params]]
(println "PARAMS" params)
(if (and (not= :login handler) (not (:user db)))
{:redirect "/login"
:db (assoc db :active-page :login)}
{:db (assoc db :active-page handler)})))
{:db (assoc db :active-page handler
:query-params params)})))
(re-frame/reg-event-db
::imported-invoices