fix misc pagination issues

This commit is contained in:
byte[] 2020-02-10 22:26:45 -05:00
parent 8f7a9b7c50
commit e4e20033e7
3 changed files with 3 additions and 2 deletions

View file

@ -17,7 +17,7 @@ defmodule PhilomenaWeb.Admin.Badge.UserController do
|> join(:inner, [u], _ in assoc(u, :awards)) |> join(:inner, [u], _ in assoc(u, :awards))
|> where([_u, a], a.badge_id == ^badge.id) |> where([_u, a], a.badge_id == ^badge.id)
|> order_by([u, _a], asc: u.name) |> order_by([u, _a], asc: u.name)
|> Repo.paginate(conn.assigns.pagination) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", title: "Users with badge #{badge.title}", users: users) render(conn, "index.html", title: "Users with badge #{badge.title}", users: users)
end end

View file

@ -28,7 +28,7 @@ defmodule PhilomenaWeb.DuplicateReportController do
|> where([d], d.state in ^states) |> where([d], d.state in ^states)
|> preload([:user, :modifier, image: [:user, :tags], duplicate_of_image: [:user, :tags]]) |> preload([:user, :modifier, image: [:user, :tags], duplicate_of_image: [:user, :tags]])
|> order_by(desc: :created_at) |> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.pagination) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", render(conn, "index.html",
title: "Duplicate Reports", title: "Duplicate Reports",

View file

@ -13,6 +13,7 @@ defmodule PhilomenaWeb.ReportController do
reports = reports =
Report Report
|> where(user_id: ^user.id) |> where(user_id: ^user.id)
|> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
polymorphic = polymorphic =