Synchronizes selected company on 1099 page to everything else.
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
[bidi.bidi :as bidi]
|
||||
[clojure.string :as str]
|
||||
[goog.crypt.base64 :as b64]
|
||||
[re-frame.core :as re-frame]))
|
||||
[re-frame.core :as re-frame]
|
||||
[auto-ap.ssr-routes :as ssr-routes]
|
||||
[cemerick.url :as url]))
|
||||
|
||||
(defn jwt->data [token]
|
||||
(js->clj (.parse js/JSON (b64/decodeString (second (str/split token #"\." ))))))
|
||||
@@ -114,11 +116,19 @@
|
||||
:is-initial-loading? false
|
||||
:active-route :initial-error)))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
(re-frame/reg-event-fx
|
||||
::swap-client
|
||||
(fn [db [_ client]]
|
||||
[with-user]
|
||||
(fn [{:keys [db user]} [_ client]]
|
||||
(.setItem js/localStorage "last-client-id" (:id client))
|
||||
(assoc db :client (:id client))))
|
||||
{:db (assoc db :client (:id client))
|
||||
:http {:token user
|
||||
:method :put
|
||||
:uri (str (bidi/path-for ssr-routes/only-routes
|
||||
:active-client
|
||||
:request-method :put)
|
||||
"?"
|
||||
(url/map->query {:search-client (:id client)}))}}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::set-active-route
|
||||
|
||||
Reference in New Issue
Block a user