Browse Source

Fix wrong type for id

Thomas Dy 2 years ago
parent
commit
a90e5b80b1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      store.ts

+ 2 - 2
store.ts

@@ -35,7 +35,7 @@ export class SqliteStore {
     recipient: string,
     newerThan: Date,
   ): Array<{ id: string; receivedAt: Date; data: string }> {
-    const result = this.db.query<[string, string, number]>(
+    const result = this.db.query<[number, string, number]>(
       `
       SELECT id, data, received_at FROM emails
       WHERE recipient = ?
@@ -46,7 +46,7 @@ export class SqliteStore {
     );
 
     return result.map(([id, data, receivedAt]) => {
-      return { id, data, receivedAt: new Date(receivedAt * 1000) };
+      return { id: `${id}`, data, receivedAt: new Date(receivedAt * 1000) };
     });
   }
 }