cleanses user's queries.

This commit is contained in:
Bryce Covert
2022-04-29 11:24:09 -07:00
parent 523afd9d37
commit 4b4246fafa
3 changed files with 19 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
[auto-ap.graphql.utils
:refer [->graphql
<-graphql
cleanse-query
assert-admin
assert-can-see-client
enum->keyword
@@ -66,7 +67,8 @@
(defn search [context {query :query client :client_id} _]
(when client
(assert-can-see-client (:id context) client))
(let [num (some-> (re-find #"([0-9]+)" query)
(let [query (cleanse-query query)
num (some-> (re-find #"([0-9]+)" query)
second
(not-empty )
Integer/parseInt)]