topicPublishHistory returns Number[] instead of BigInt[]
authorJustin Wind <justin.wind+git@gmail.com>
Sun, 13 Mar 2022 22:04:07 +0000 (15:04 -0700)
committerJustin Wind <justin.wind+git@gmail.com>
Sun, 13 Mar 2022 22:04:07 +0000 (15:04 -0700)
src/db/postgres/index.js
src/db/sqlite/index.js

index 3e97336992999adaee4a077c1f7ef9ddc7719a87..fc4ec8daa1b229ec353ebfeff8cf5ac3d917a6d8 100644 (file)
@@ -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;
   }
index cc4ea90af056db2c99f747f2705e25829801749a..31471bafb850c9d761ffc19931968658eb093258 100644 (file)
@@ -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;
   }