summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-05-21 17:52:47 -0500
committerAlex Gleason <alex@alexgleason.me>2021-05-21 17:52:47 -0500
commit81eeba87fca001a6b4c01755123821bfdd5b91cf (patch)
treebafb160b74bd51cc50751695bd50fb8957da53a1
parent934fb45fbe1e94b542ca14786721f72532a08cb3 (diff)
Cycles: Pleroma.Web.AdminAPI.Search.not_empty_string/1 --> Pleroma.User.Query.not_empty_string/1
-rw-r--r--lib/pleroma/user/query.ex7
-rw-r--r--lib/pleroma/web/admin_api/search.ex6
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex
index fa46545da..49e493ae0 100644
--- a/lib/pleroma/user/query.ex
+++ b/lib/pleroma/user/query.ex
@@ -27,7 +27,6 @@ defmodule Pleroma.User.Query do
- e.g. Pleroma.User.Query.build(%{ap_id: ["http://ap_id1", "http://ap_id2"]})
"""
import Ecto.Query
- import Pleroma.Web.AdminAPI.Search, only: [not_empty_string: 1]
alias Pleroma.FollowingRelationship
alias Pleroma.User
@@ -65,6 +64,12 @@ defmodule Pleroma.User.Query do
@equal_criteria [:email]
@contains_criteria [:ap_id, :nickname]
+ defmacro not_empty_string(string) do
+ quote do
+ is_binary(unquote(string)) and unquote(string) != ""
+ end
+ end
+
@spec build(Query.t(), criteria()) :: Query.t()
def build(query \\ base_query(), criteria) do
prepare_query(query, criteria)
diff --git a/lib/pleroma/web/admin_api/search.ex b/lib/pleroma/web/admin_api/search.ex
index eeeebdf4e..01d974479 100644
--- a/lib/pleroma/web/admin_api/search.ex
+++ b/lib/pleroma/web/admin_api/search.ex
@@ -10,12 +10,6 @@ defmodule Pleroma.Web.AdminAPI.Search do
@page_size 50
- defmacro not_empty_string(string) do
- quote do
- is_binary(unquote(string)) and unquote(string) != ""
- end
- end
-
@spec user(map()) :: {:ok, [User.t()], pos_integer()}
def user(params \\ %{}) do
query =