From 5c0c013d7029267a1d6a8682314ec988ec547f52 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Wed, 17 Aug 2022 13:02:22 -0600 Subject: [PATCH] First order must be closeTime --- functions/src/weekly-markets-emails.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/functions/src/weekly-markets-emails.ts b/functions/src/weekly-markets-emails.ts index 0cad16f8..82e1f660 100644 --- a/functions/src/weekly-markets-emails.ts +++ b/functions/src/weekly-markets-emails.ts @@ -24,6 +24,7 @@ async function getTrendingContracts() { .where('isResolved', '==', false) .where('closeTime', '>', Date.now() + DAY_MS) .where('visibility', '==', 'public') + .orderBy('closeTime', 'asc') .orderBy('popularityScore', 'desc') .limit(50) )