implementing permissions to companies
This commit is contained in:
@@ -3,12 +3,7 @@
|
||||
(def default-db
|
||||
{:user (.getItem js/localStorage "jwt")
|
||||
:company {:name "Campbell Brewing Company"}
|
||||
:companies [{:name "Campbell Brewing Company"
|
||||
:matches ["campbell brewing company" "campbell brewery company" "campbell brewing"]}
|
||||
{:name "Brown Chicken Brown Cow"
|
||||
:matches ["brown chicken brown cow"]}
|
||||
{:name "Naschmarkt Restaurant"
|
||||
:matches ["naschmarkt" "naschmarkt restaurant"]}]
|
||||
:companies []
|
||||
:invoices {:pending #{}
|
||||
:unpaid #{}}
|
||||
:status {:loading false}
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
(re-frame/reg-sub
|
||||
::companies
|
||||
(fn [db]
|
||||
(:companies db)))
|
||||
(when (:user db)
|
||||
(let [{:strs [companies] :as x} (js->clj (.parse js/JSON (base64/decodeString (second (str/split (:user db) #"\.")))))]
|
||||
(map (fn [c] {:name c}) companies)))))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::menu
|
||||
|
||||
Reference in New Issue
Block a user