From e6244a614a81bca6a94b2c131ab5724a1935a198 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Mon, 20 Jan 2025 19:14:55 -0700 Subject: [PATCH] Add logging for /getSession --- routes/hub.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routes/hub.js b/routes/hub.js index 33cace4..4f0c189 100644 --- a/routes/hub.js +++ b/routes/hub.js @@ -10,6 +10,7 @@ router.get('/getSession', async (req, res) => { try { const pid = req.query.robloxPlayerId; if (!pid) return res.status(400).json({ status: 400, message: 'Missing Roblox Player ID' }); + log.info(`GET /hub/getSession?robloxPlayerId=${pid}`); const [row] = await pool.query('SELECT * FROM users WHERE robloxId = ?', [pid]); if (!row) { const pairingCode = Math.floor(100000 + Math.random() * 900000).toString(); @@ -27,8 +28,6 @@ router.get('/getSession', async (req, res) => { const purchases = await pool.query('SELECT * FROM purchases WHERE hubId = ?', [hub.id]); // Generate bestSeller object from purchases. Find what product id has the most sales, then make the object const purchaseCounts = purchases.reduce((acc, purchase) => { - console.log(acc) - console.log(purchase) acc[purchase.productId] = (acc[purchase.productId] || 0) + 1; return acc; }, {});