aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2020-09-25 16:04:01 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2020-10-22 11:53:28 +0300
commit60663150b5b936c831bdc0cfeade30867e536317 (patch)
tree77365f170fc98713d51a08ed9e64f6e3f3123096 /lib
parent46b420aa602050d7b3bff33a6b51d54852b2adb3 (diff)
downloadpleroma-60663150b5b936c831bdc0cfeade30867e536317.tar.gz
admin user search: added filter by `actor_type`
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/user/query.ex7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex
index 711439eef..7ef2a1455 100644
--- a/lib/pleroma/user/query.ex
+++ b/lib/pleroma/user/query.ex
@@ -56,7 +56,8 @@ defmodule Pleroma.User.Query do
ap_id: [String.t()],
order_by: term(),
select: term(),
- limit: pos_integer()
+ limit: pos_integer(),
+ actor_types: [String.t()]
}
| map()
@@ -115,6 +116,10 @@ defmodule Pleroma.User.Query do
where(query, [u], u.is_admin == ^bool)
end
+ defp compose_query({:actor_types, actor_types}, query) when is_list(actor_types) do
+ where(query, [u], u.actor_type in ^actor_types)
+ end
+
defp compose_query({:is_moderator, bool}, query) do
where(query, [u], u.is_moderator == ^bool)
end