From: Justin Wind Date: Sun, 13 Mar 2022 22:04:07 +0000 (-0700) Subject: topicPublishHistory returns Number[] instead of BigInt[] X-Git-Tag: v1.3.6^2~4 X-Git-Url: https://git.squeep.com/?p=websub-hub;a=commitdiff_plain;h=18eee8e467173aee380bd0727d7065469e706727 topicPublishHistory returns Number[] instead of BigInt[] --- 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; }