filtering down to just active invoices/etc.
This commit is contained in:
@@ -142,9 +142,10 @@
|
||||
|
||||
|
||||
|
||||
(defn base-graphql [{:keys [imported company-id status id]}]
|
||||
(defn base-graphql [{:keys [imported company-id status id statuses]}]
|
||||
(cond-> base-query
|
||||
(limited-companies id) (helpers/merge-where [:in :company-id (limited-companies id)])
|
||||
(seq statuses ) (helpers/merge-where [:in :status statuses])
|
||||
(not (nil? imported)) (helpers/merge-where [:= :imported imported])
|
||||
(not (nil? status)) (helpers/merge-where [:= :status status])
|
||||
(not (nil? company-id)) (helpers/merge-where [:= :company-id company-id])))
|
||||
@@ -152,6 +153,7 @@
|
||||
(defn get-graphql [{:keys [start sort-by asc limit] :as args :or {limit 20}}]
|
||||
(query
|
||||
(cond-> (base-graphql args)
|
||||
|
||||
true (add-sort-by sort-by asc)
|
||||
true (assoc :limit limit)
|
||||
start (assoc :offset start))))
|
||||
|
||||
Reference in New Issue
Block a user