Adds support for transaction rules case insensitive search
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
[auto-ap.datomic :refer [uri merge-query apply-sort-3 apply-pagination add-sorter-fields]]
|
||||
[auto-ap.graphql.utils :refer [limited-clients]]
|
||||
[clojure.set :refer [rename-keys]]
|
||||
[clj-time.coerce :as c]))
|
||||
[clj-time.coerce :as c]
|
||||
[clojure.string :as str]))
|
||||
|
||||
(defn <-datomic [result]
|
||||
result)
|
||||
@@ -52,6 +53,12 @@
|
||||
:where ['[?e :transaction-rule/vendor ?vendor-id]]}
|
||||
:args [(:vendor-id args)]})
|
||||
|
||||
(not (str/blank? (:note args)))
|
||||
(merge-query {:query {:in ['?note-pattern]
|
||||
:where ['[?e :transaction-rule/note ?n]
|
||||
'[(re-find ?note-pattern ?n)]]}
|
||||
:args [(re-pattern (str "(?i)" (:note args)))]})
|
||||
|
||||
true
|
||||
(merge-query {:query {:find ['?e]
|
||||
:where ['[?e :transaction-rule/transaction-approval-status]]}}))]
|
||||
|
||||
@@ -626,7 +626,8 @@
|
||||
:start {:type 'Int}
|
||||
:per_page {:type 'Int}
|
||||
:sort {:type '(list :sort_item)}
|
||||
:asc {:type 'Boolean}}
|
||||
:asc {:type 'Boolean}
|
||||
:note {:type 'String}}
|
||||
:resolve :get-transaction-rule-page}
|
||||
|
||||
:ledger_page {:type :ledger_page
|
||||
|
||||
Reference in New Issue
Block a user