Adds default filtering and sorting
This commit is contained in:
@@ -790,9 +790,10 @@
|
||||
(:sort args)))
|
||||
|
||||
(defn apply-sort-3 [args results]
|
||||
|
||||
(let [sort-bys (conj (:sort args)
|
||||
{:sort-key "default" :asc true})
|
||||
{:sort-key "default" :asc (if (contains? args :default-asc?)
|
||||
(:default-asc? args)
|
||||
true)})
|
||||
length (count sort-bys)
|
||||
comparator (fn [xs ys]
|
||||
(reduce
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
(cond->> query
|
||||
true (d/query)
|
||||
true (apply-sort-3 args)
|
||||
true (apply-sort-3 (assoc args :default-asc? false))
|
||||
true (apply-pagination args))))
|
||||
|
||||
(defn graphql-results [ids db args]
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
(log/info "query is" query)
|
||||
(cond->> query
|
||||
true (d/query)
|
||||
true (apply-sort-3 args)
|
||||
true (apply-sort-3 (assoc args :default-asc? false))
|
||||
true (apply-pagination args)))))
|
||||
|
||||
(defn graphql-results [ids db args]
|
||||
|
||||
Reference in New Issue
Block a user