diff --git a/index.js b/index.js index 3ea80d2..4d7fd41 100644 --- a/index.js +++ b/index.js @@ -478,7 +478,7 @@ app.get("/api/v1/admin/callLogs", (req, res) => { // Get full count of call logs to calculate total pages pool.getConnection().then(conn => { 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) => { // Turn all values in rows to strings, prevents type issues with bigints. rows = rows.map(row => {