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
1 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,11 @@ defmacro not_empty_string(string) do
@spec user(map()) :: {:ok, [User.t()], pos_integer()}
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 =
User.Query.paginate(query, params[:page] || 1, params[:page_size] || @page_size)