From e4e20033e76561cb48dfeadb2bf09db9ea94b129 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Mon, 10 Feb 2020 22:26:45 -0500 Subject: [PATCH] fix misc pagination issues --- lib/philomena_web/controllers/admin/badge/user_controller.ex | 2 +- lib/philomena_web/controllers/duplicate_report_controller.ex | 2 +- lib/philomena_web/controllers/report_controller.ex | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/philomena_web/controllers/admin/badge/user_controller.ex b/lib/philomena_web/controllers/admin/badge/user_controller.ex index e4f9a841..6d3a63cd 100644 --- a/lib/philomena_web/controllers/admin/badge/user_controller.ex +++ b/lib/philomena_web/controllers/admin/badge/user_controller.ex @@ -17,7 +17,7 @@ defmodule PhilomenaWeb.Admin.Badge.UserController do |> join(:inner, [u], _ in assoc(u, :awards)) |> where([_u, a], a.badge_id == ^badge.id) |> 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) end diff --git a/lib/philomena_web/controllers/duplicate_report_controller.ex b/lib/philomena_web/controllers/duplicate_report_controller.ex index 73a3e115..af68fbd2 100644 --- a/lib/philomena_web/controllers/duplicate_report_controller.ex +++ b/lib/philomena_web/controllers/duplicate_report_controller.ex @@ -28,7 +28,7 @@ defmodule PhilomenaWeb.DuplicateReportController do |> where([d], d.state in ^states) |> preload([:user, :modifier, image: [:user, :tags], duplicate_of_image: [:user, :tags]]) |> order_by(desc: :created_at) - |> Repo.paginate(conn.assigns.pagination) + |> Repo.paginate(conn.assigns.scrivener) render(conn, "index.html", title: "Duplicate Reports", diff --git a/lib/philomena_web/controllers/report_controller.ex b/lib/philomena_web/controllers/report_controller.ex index 32f753e2..c460fd1d 100644 --- a/lib/philomena_web/controllers/report_controller.ex +++ b/lib/philomena_web/controllers/report_controller.ex @@ -13,6 +13,7 @@ defmodule PhilomenaWeb.ReportController do reports = Report |> where(user_id: ^user.id) + |> order_by(desc: :created_at) |> Repo.paginate(conn.assigns.scrivener) polymorphic =