Fix "the call ... will never return" warning

This commit is contained in:
Maxim Filippov 2019-10-31 02:25:15 +03:00
parent 9b40e5f563
commit 59a149c69a

View File

@ -18,7 +18,11 @@ defmodule Pleroma.Web.AdminAPI.Search do
@spec user(map()) :: {:ok, [User.t()], pos_integer()} @spec user(map()) :: {:ok, [User.t()], pos_integer()}
def user(params \\ %{}) do def user(params \\ %{}) do
query = User.Query.build(params) |> order_by([u], u.nickname) query =
params
|> Map.drop([:page, :page_size])
|> User.Query.build()
|> order_by([u], u.nickname)
paginated_query = paginated_query =
User.Query.paginate(query, params[:page] || 1, params[:page_size] || @page_size) User.Query.paginate(query, params[:page] || 1, params[:page_size] || @page_size)