(cloud) big performance improvements for page load.

This commit is contained in:
2023-04-06 14:38:22 -07:00
parent 2a0f736af7
commit 5561861d3d
10 changed files with 349 additions and 272 deletions

View File

@@ -16,7 +16,13 @@
(js->clj (.parse js/JSON (b64/decodeString (second (str/split token #"\." ))))))
(defn client-query [token]
(defn client-query []
(cond-> [:id :name :code :email :locations :feature-flags
[:emails [:id :email :description]]
[:bank-accounts [:id :code :bank-name :name :type :visible
:locations :include-in-reports :current-balance]]]))
(defn client-detail-query [token]
(cond-> [:id :name :signature-file :code :email :matches :week-a-debits :week-a-credits :week-b-debits :week-b-credits :locations :locked-until :square-auth-token :feature-flags
[:square-integration-status [:last-updated :last-attempt :message :state :id]]
[:square-locations [:square-id :id :name :client-location]]
@@ -68,7 +74,7 @@
:query-params (auto-ap.views.utils/query-params)
:user token)
:graphql {:token token
:query-obj {:venia/queries [[:client (client-query token)]]}
:query-obj {:venia/queries [[:client (client-query)]]}
:on-success [::received-initial]
:on-error [::failed-initial]}}))))
@@ -100,7 +106,7 @@
(fn [{:keys [db]}]
(let [token (-> db :user)]
{:graphql {:token token
:query-obj {:venia/queries [[:client (client-query token)]]}
:query-obj {:venia/queries [[:client (client-query)]]}
:on-success [::received-refreshed-clients]}})))
(re-frame/reg-event-fx