This commit is contained in:
Christopher Cookman 2026-02-18 14:05:45 -07:00
parent ed75e56d2c
commit 3100125380

View file

@ -478,7 +478,7 @@ app.get("/api/v1/admin/callLogs", (req, res) => {
// Get full count of call logs to calculate total pages // Get full count of call logs to calculate total pages
pool.getConnection().then(conn => { pool.getConnection().then(conn => {
conn.query("SELECT COUNT(*) as count FROM callLogs").then((rows) => { conn.query("SELECT COUNT(*) as count FROM callLogs").then((rows) => {
const totalPages = Math.ceil(rows[0].count / 100); const totalPages = Math.ceil(Number(rows[0].count) / 100);
conn.query("SELECT * FROM callLogs ORDER BY timestamp DESC LIMIT 100 OFFSET ?", [offset]).then((rows) => { 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. // Turn all values in rows to strings, prevents type issues with bigints.
rows = rows.map(row => { rows = rows.map(row => {