1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.AdminAPI.Search do
13 @spec user(map()) :: {:ok, [User.t()], pos_integer()}
14 def user(params \\ %{}) do
17 |> Map.drop([:page, :page_size])
18 |> Map.put(:invisible, false)
20 |> order_by(desc: :id)
23 User.Query.paginate(query, params[:page] || 1, params[:page_size] || @page_size)
25 count = Repo.aggregate(query, :count, :id)
27 results = Repo.all(paginated_query)