Makes multiple client selection somewhat possible via graphql.

This commit is contained in:
2023-08-31 13:05:06 -07:00
parent 9c472dfc8e
commit 1d82ec29e0
29 changed files with 274 additions and 139 deletions

View File

@@ -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)