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; });