Makes multiple client selection somewhat possible via graphql.
This commit is contained in:
@@ -40,15 +40,13 @@
|
||||
([db args]
|
||||
(let [check-number-like (try (Long/parseLong (:check-number-like args)) (catch Exception _ nil))
|
||||
query (if (:exact-match-id args)
|
||||
(cond-> {:query {:find '[?e]
|
||||
:in '[$ ?e]
|
||||
:where '[[?e :payment/client ?c]]}
|
||||
:args [db
|
||||
(:exact-match-id args)]}
|
||||
(limited-clients (:id args))
|
||||
(merge-query {:query {:in ['[?xx ...]]
|
||||
:where ['[?e :payment/client ?xx]]}
|
||||
:args [(set (map :db/id (limited-clients (:id args))))]}))
|
||||
{:query {:find '[?e]
|
||||
:in '[$ ?e [?c ...]]
|
||||
:where '[[?e :payment/client ?c]]}
|
||||
:args [db
|
||||
(:exact-match-id args)
|
||||
(map :db/id (:clients args))]
|
||||
}
|
||||
(cond-> {:query {:find []
|
||||
:in ['$]
|
||||
:where []}
|
||||
@@ -69,10 +67,10 @@
|
||||
:where []}
|
||||
:args [(:exact-match-id args)]})
|
||||
|
||||
(limited-clients (:id args))
|
||||
(seq (:clients args))
|
||||
(merge-query {:query {:in ['[?xx ...]]
|
||||
:where ['[?e :payment/client ?xx]]}
|
||||
:args [(set (map :db/id (limited-clients (:id args))))]})
|
||||
:args [(map :db/id (:clients args))]})
|
||||
|
||||
|
||||
(:client-id args)
|
||||
|
||||
Reference in New Issue
Block a user