vendor querying step 1.
This commit is contained in:
@@ -117,3 +117,21 @@
|
||||
(defn get-graphql [context args value]
|
||||
(->graphql
|
||||
(d-vendors/get-graphql (assoc args :id (:id context)))))
|
||||
|
||||
(defn get-by-id [context args value]
|
||||
(->graphql
|
||||
(d-vendors/get-graphql-by-id (assoc args :id (:id context))
|
||||
(:id args))))
|
||||
|
||||
(defn search [context args value]
|
||||
(->> (d/q '[:find ?n ?i ?s
|
||||
:in $ ?q
|
||||
:where [(fulltext $ :vendor/search-terms ?q) [[?i ?n _ ?s]]]
|
||||
(not [?i :vendor/hidden true])]
|
||||
(d/db conn)
|
||||
(:query args))
|
||||
(sort-by last)
|
||||
(map (fn [[n i]]
|
||||
{:name n
|
||||
:id i}
|
||||
))))
|
||||
|
||||
Reference in New Issue
Block a user