From 14d5c22fc7128f49ace6ec57004d7c1dc40de7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CA=9C=C9=AA=C9=B4=E1=B4=87=C9=AA=20N=E1=B4=8F=E1=B4=9C?= =?UTF-8?q?=E1=B4=A2=E1=B4=87=C9=B4?= <157171073+Shineii86@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:00:58 +0530 Subject: [PATCH] fix: remove unused 'app' param from createApiRoutes to fix jsonError/jsonResponse parameter shift The function signature was (app, jsonResponse, jsonError) but called with (jsonResponse, jsonError) from server.js, causing all parameters to shift by one. jsonResponse() was actually calling jsonError(), returning {success: false, message: data} instead of {success: true, results: data}. --- src/routes/apiRoutes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/apiRoutes.js b/src/routes/apiRoutes.js index 3686fd1..eac101b 100644 --- a/src/routes/apiRoutes.js +++ b/src/routes/apiRoutes.js @@ -36,7 +36,7 @@ const { getCached, setCache } = require("../helpers/cache"); * @param {function} jsonError - Standardized error response wrapper * @returns {express.Router} Configured router */ -const createApiRoutes = (app, jsonResponse, jsonError) => { +const createApiRoutes = (jsonResponse, jsonError) => { const router = express.Router(); // ══════════════════════════════════════════════════════════════