avoids duplicate invoices atomic, prevents query that causes warnings.
This commit is contained in:
@@ -466,6 +466,19 @@
|
||||
(-> context
|
||||
(assoc-in [:coeffects :user] (get-in context [:coeffects :db :user]))))))
|
||||
|
||||
(def with-role
|
||||
(re-frame/->interceptor
|
||||
:id :with-role
|
||||
:before (fn [context]
|
||||
(-> context
|
||||
(assoc-in [:coeffects :role] (-> (get-in context [:coeffects :db :user])
|
||||
(str/split #"\.")
|
||||
second
|
||||
(base64/decodeString )
|
||||
(#(.parse js/JSON % ))
|
||||
(js->clj :keywordize-keys true)
|
||||
:user/role))))))
|
||||
|
||||
(def with-is-admin?
|
||||
(re-frame/->interceptor
|
||||
:id :with-is-admin?
|
||||
|
||||
Reference in New Issue
Block a user