fix.
This commit is contained in:
@@ -147,18 +147,20 @@
|
|||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
::params-change
|
::params-change
|
||||||
(fn [cofx [_ params]]
|
(fn [cofx [_ params]]
|
||||||
{:db (-> (:db cofx)
|
(let [c @(re-frame/subscribe [::subs/client])]
|
||||||
(assoc-in [::loading] true)
|
(cond-> {:db (-> (:db cofx)
|
||||||
(assoc-in [::params] params))
|
(assoc-in [::loading] true)
|
||||||
:graphql {:token (-> cofx :db :user)
|
(assoc-in [::params] params))}
|
||||||
:query-obj {:venia/queries [[:profit-and-loss
|
c (assoc :graphql (when @(re-frame/subscribe [::subs/client])
|
||||||
{:client-id (:id @(re-frame/subscribe [::subs/client]))
|
{:token (-> cofx :db :user)
|
||||||
:from-date (:from-date params)
|
:query-obj {:venia/queries [[:profit-and-loss
|
||||||
:to-date (:to-date params)}
|
{:client-id (:id c)
|
||||||
[[:balance-sheet-accounts [:name :amount :account-type :id :numeric-code :location]]
|
:from-date (:from-date params)
|
||||||
[:comparable-balance-sheet-accounts [:name :amount :account-type :id :numeric-code :location]]]]]}
|
:to-date (:to-date params)}
|
||||||
:on-success [::received]
|
[[:balance-sheet-accounts [:name :amount :account-type :id :numeric-code :location]]
|
||||||
:on-error [::error]}}))
|
[:comparable-balance-sheet-accounts [:name :amount :account-type :id :numeric-code :location]]]]]}
|
||||||
|
:on-success [::received]
|
||||||
|
:on-error [::error]}))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user