From 52726be73224b1635ac0b851a9433367c38fd2af Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 18 Feb 2026 13:59:08 -0700 Subject: [PATCH] Possible fix to callLogs api? --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index 82e4c29..ae80bb7 100644 --- a/index.js +++ b/index.js @@ -480,6 +480,14 @@ app.get("/api/v1/admin/callLogs", (req, res) => { conn.query("SELECT COUNT(*) as count FROM callLogs").then((rows) => { const totalPages = Math.ceil(rows[0].count / 100); conn.query("SELECT * FROM callLogs ORDER BY timestamp DESC LIMIT 100 OFFSET ?", [offset]).then((rows) => { + // Turn all values in rows to strings, prevents type issues with bigints. + rows = rows.map(row => { + const newRow = {}; + for (const key in row) { + newRow[key] = String(row[key]); + } + return newRow; + }); res.json({ totalPages, page, data: rows }); }).catch(err => { console.error('Error getting call logs:', err);