From 062d180e3d3cb0cf9c3ca3c3c07d7bf2392f247f Mon Sep 17 00:00:00 2001 From: Cam Proudlock Date: Fri, 28 Aug 2026 18:04:29 -0400 Subject: [PATCH] Stop sending the redundant per_page parameter on every list request --- frontend/src/api/index.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js index 3fed03f9..841fc788 100644 --- a/frontend/src/api/index.js +++ b/frontend/src/api/index.js @@ -16,10 +16,18 @@ api.interceptors.request.use(config => { if (token) { config.headers.Authorization = `Bearer ${token}` } - // Send both perpage and per_page for backend compatibility - if (config.params?.perpage) { - config.params.per_page = config.params.perpage - } + // `per_page` used to be sent alongside `perpage` for backend compatibility. + // get_pagination_params reads `perpage` and only falls back to `per_page`, and + // this client always sends `perpage`, so the duplicate never did anything - + // it just made every list URL carry a redundant parameter. + // + // Dropping it also has a one-off benefit worth recording. The endpoints list + // route used to redirect (308, PERMANENT and therefore cached by the browser + // against the exact URL including its query string). Clients that hit the old + // route hold that rewrite even after the server is fixed: the request never + // leaves the machine, so nothing deployed can clear it. Changing the query + // string changes the cache key, so those clients miss the poisoned entry and + // reach the corrected route. return config })