diff --git a/src/clj/auto_ap/graphql/vendors.clj b/src/clj/auto_ap/graphql/vendors.clj index 62820f8f..717b73e2 100644 --- a/src/clj/auto_ap/graphql/vendors.clj +++ b/src/clj/auto_ap/graphql/vendors.clj @@ -82,6 +82,7 @@ :vendor/legal-entity-tin-type (enum->keyword (:legal_entity_tin_type in) "legal-entity-tin-type") :vendor/legal-entity-1099-type (enum->keyword (:legal_entity_1099_type in) "legal-entity-1099-type"))))] (is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/account-overrides account-overrides]) + (is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/search-terms [name]]) (is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/terms-overrides terms-overrides]) (is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/schedule-payment-dom schedule-payment-dom]) (is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/automatically-paid-when-due @@ -112,9 +113,6 @@ (audit-transact transaction (:id context)) to)) -#_(defn get-graphql [context args value] - (->graphql - (d-vendors/get-graphql (assoc args :id (:id context))))) (defn get-graphql [context args _] (assert-admin (:id context)) @@ -122,12 +120,12 @@ [vendors vendors-count ] (d-vendors/get-graphql (<-graphql args))] (result->page vendors vendors-count :vendors args))) -(defn get-by-id [context args value] +(defn get-by-id [context args _] (->graphql (d-vendors/get-graphql-by-id (assoc args :id (:id context)) (:id args)))) -(defn search [context args value] +(defn search [_ args _] (->> (d/q '[:find ?n ?i ?s :in $ ?q :where [(fulltext $ :vendor/search-terms ?q) [[?i ?n _ ?s]]] @@ -137,5 +135,4 @@ (sort-by last) (map (fn [[n i]] {:name n - :id i} - )))) + :id i}))))