From 9f65fcab71e5a143617e3bda4a44e4d94c326e9b Mon Sep 17 00:00:00 2001 From: corbz Date: Thu, 18 Jan 2024 20:22:15 +0000 Subject: [PATCH] fixed invalid page error The page would be above 1, and then would query the API with a new filter that reduced the results to a single page, causing an error. --- apps/static/js/tickets.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/static/js/tickets.js b/apps/static/js/tickets.js index e16d554..0e14919 100644 --- a/apps/static/js/tickets.js +++ b/apps/static/js/tickets.js @@ -185,12 +185,12 @@ function changeItemsPage(next) { else if (!next && pagination.prev) page --; else return; - filters["page"] = page; - loadTicketItems(); + loadTicketItems(page); } -function loadTicketItems() { +function loadTicketItems(page=1) { updateInterfaceState("loading"); + filters["page"] = page; fetchTicketsPromise(filters).then((response) => { // Update the counts to show how many tickets were found