From 8441f0e5a55554855d56cacbe24d10ccbd97ee10 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 18 Feb 2026 14:01:20 -0700 Subject: [PATCH] Possible fix to callLogs api? Part 2 --- index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ae80bb7..a89ee1b 100644 --- a/index.js +++ b/index.js @@ -484,7 +484,17 @@ app.get("/api/v1/admin/callLogs", (req, res) => { rows = rows.map(row => { const newRow = {}; for (const key in row) { - newRow[key] = String(row[key]); + // Convert BigInt explicitly to avoid "Cannot mix BigInt and other types" errors, + // handle Dates and null/undefined safely, otherwise coerce to string. + if (typeof row[key] === 'bigint') { + newRow[key] = row[key].toString(); + } else if (row[key] instanceof Date) { + newRow[key] = row[key].toISOString(); + } else if (row[key] === null || row[key] === undefined) { + newRow[key] = null; + } else { + newRow[key] = String(row[key]); + } } return newRow; });