making ssr pages incorporate auth.
This commit is contained in:
@@ -8,14 +8,19 @@
|
||||
merge-query
|
||||
pull-many
|
||||
query2]]
|
||||
[auto-ap.graphql.utils :refer [can-see-client? limited-clients]]
|
||||
[auto-ap.graphql.utils :refer [can-see-client? extract-client-ids]]
|
||||
[clj-time.coerce :as c]
|
||||
[datomic.api :as dc]))
|
||||
|
||||
(def default-read '[:db/id :report/client :report/created :report/url :report/name :report/creator])
|
||||
|
||||
(defn raw-graphql-ids [db args]
|
||||
(let [query (cond-> {:query {:find []
|
||||
|
||||
(let [valid-clients (extract-client-ids (:clients args)
|
||||
(:client-id args)
|
||||
(when (:client-code args)
|
||||
[:client/code (:client-code args)]))
|
||||
query (cond-> {:query {:find []
|
||||
:in ['$ ]
|
||||
:where []}
|
||||
:args [db]}
|
||||
@@ -24,7 +29,7 @@
|
||||
(seq (:clients args))
|
||||
(merge-query {:query {:in ['[?xx ...]]
|
||||
:where ['[?e :report/client ?xx]]}
|
||||
:args [(set (map :db/id (:clients args)))]})
|
||||
:args [valid-clients]})
|
||||
|
||||
(:sort args) (add-sorter-fields {"client" ['[?e :report/client ?c]
|
||||
'[?c :client/name ?sort-client]]
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
merge-query
|
||||
pull-many
|
||||
query2]]
|
||||
[auto-ap.graphql.utils :refer [limited-clients]]
|
||||
[auto-ap.graphql.utils :refer [extract-client-ids]]
|
||||
[clj-time.coerce :as c]
|
||||
[datomic.api :as dc]))
|
||||
|
||||
@@ -18,36 +18,37 @@
|
||||
(-> x (update :yodlee-provider-account/last-updated c/from-date)))
|
||||
|
||||
(defn raw-graphql-ids [db args]
|
||||
(->> (cond-> {:query {:find []
|
||||
:in ['$]
|
||||
:where ['[?e :yodlee-provider-account/id]]}
|
||||
:args [db]}
|
||||
(let [valid-clients (extract-client-ids (:clients args)
|
||||
(:client-id args)
|
||||
(when (:client-code args)
|
||||
[:client/code (:client-code args)]))]
|
||||
(->> (cond-> {:query {:find []
|
||||
:in ['$ '[?xx ...]]
|
||||
:where ['[?e :yodlee-provider-account/id]
|
||||
'[?e :yodlee-provider-account/client ?xx]]}
|
||||
:args [db valid-clients]}
|
||||
|
||||
(seq (:clients args))
|
||||
(merge-query {:query {:in ['[?xx ...]]
|
||||
:where ['[?e :yodlee-provider-account/client ?xx]]}
|
||||
:args [(set (map :db/id (:clients args)))]})
|
||||
|
||||
(:client-id args)
|
||||
(merge-query {:query {:in ['?client-id]
|
||||
:where ['[?e :yodlee-provider-account/client ?client-id]]}
|
||||
:args [ (:client-id args)]})
|
||||
(:client-id args)
|
||||
(merge-query {:query {:in ['?client-id]
|
||||
:where ['[?e :yodlee-provider-account/client ?client-id]]}
|
||||
:args [ (:client-id args)]})
|
||||
|
||||
(:client-code args)
|
||||
(merge-query {:query {:in ['?client-code]
|
||||
:where ['[?e :yodlee-provider-account/client ?client-id]
|
||||
'[?client-id :client/code ?client-code]]}
|
||||
:args [ (:client-code args)]})
|
||||
(:client-code args)
|
||||
(merge-query {:query {:in ['?client-code]
|
||||
:where ['[?e :yodlee-provider-account/client ?client-id]
|
||||
'[?client-id :client/code ?client-code]]}
|
||||
:args [ (:client-code args)]})
|
||||
|
||||
(:sort args) (add-sorter-fields {"status" ['[?e :yodlee-provider-account/status ?sort-status]]}
|
||||
args)
|
||||
true
|
||||
(merge-query {:query {:find ['?e ]
|
||||
:where ['[?e :yodlee-provider-account/id]]}}) )
|
||||
(:sort args) (add-sorter-fields {"status" ['[?e :yodlee-provider-account/status ?sort-status]]}
|
||||
args)
|
||||
true
|
||||
(merge-query {:query {:find ['?e ]
|
||||
:where ['[?e :yodlee-provider-account/id]]}}) )
|
||||
|
||||
(query2)
|
||||
(apply-sort-3 args)
|
||||
(apply-pagination args)))
|
||||
(query2)
|
||||
(apply-sort-3 args)
|
||||
(apply-pagination args))))
|
||||
|
||||
|
||||
(defn graphql-results [ids db _]
|
||||
|
||||
Reference in New Issue
Block a user