From cd6558f084ea1c8f8ebf5f82cc033729d6534240 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 18 Feb 2026 14:26:43 -0700 Subject: [PATCH] Change some stuff to callLog api --- index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 4d7fd41..b2a8ae2 100644 --- a/index.js +++ b/index.js @@ -486,14 +486,16 @@ app.get("/api/v1/admin/callLogs", (req, res) => { for (const key in row) { // 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]); + switch (key) { + case 'timestamp': + newRow[key] = new Date(row[key]).toISOString(); + break; + case 'success': + newRow[key] = Boolean(row[key]); + break; + default: + newRow[key] = new String(row[key]); + break; } } return newRow;