From 18eee8e467173aee380bd0727d7065469e706727 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Sun, 13 Mar 2022 15:04:07 -0700 Subject: [PATCH] topicPublishHistory returns Number[] instead of BigInt[] --- src/db/postgres/index.js | 2 +- src/db/sqlite/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/postgres/index.js b/src/db/postgres/index.js index 3e97336..fc4ec8d 100644 --- a/src/db/postgres/index.js +++ b/src/db/postgres/index.js @@ -862,7 +862,7 @@ class DatabasePostgres extends Database { const events = await dbCtx.manyOrNone(this.statement.topicPublishHistory, { topicIds: [topicId], daysAgo: days }); const history = Array.from({ length: days }, () => 0); - events.forEach(({ daysAgo, contentUpdates }) => history[daysAgo] = contentUpdates); + events.forEach(({ daysAgo, contentUpdates }) => history[daysAgo] = Number(contentUpdates)); return history; } diff --git a/src/db/sqlite/index.js b/src/db/sqlite/index.js index cc4ea90..31471ba 100644 --- a/src/db/sqlite/index.js +++ b/src/db/sqlite/index.js @@ -828,7 +828,7 @@ class DatabaseSQLite extends Database { const events = this.statement.topicPublishHistory.all({ topicId, daysAgo: days }); const history = Array.from({ length: days }, () => 0); - events.forEach(({ daysAgo, contentUpdates }) => history[daysAgo] = contentUpdates); + events.forEach(({ daysAgo, contentUpdates }) => history[daysAgo] = Number(contentUpdates)); return history; } -- 2.43.2