Skip to content

Commit

Permalink
Quotes API v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleylamont committed Oct 16, 2024
1 parent d99deee commit 35e2dbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/quotes-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export async function attachQuotesServer(app: Express) {
response.set("Content-Type", "application/json");
response.send(
JSON.stringify({
quotes: [...quotes.values()].sort(
(a, b) => b.timestamp.getTime() - a.timestamp.getTime(),
),
quotes: [...quotes.entries()]
.map(([messageId, quote]) => ({ messageId, ...quote }))
.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime()),
}),
);
});
Expand Down

0 comments on commit 35e2dbc

Please sign in to comment.