Improve ordering of getRecentStoryReplies

This commit is contained in:
trevor-signal
2025-12-08 11:23:46 -05:00
committed by GitHub
parent f78b36c46a
commit 5d41b9c1ef

View File

@@ -3764,13 +3764,13 @@ function getRecentStoryReplies(
(
${timeFilter}
)
ORDER BY received_at DESC, sent_at DESC
`;
const template = sqlFragment`
SELECT first.* FROM (${createQuery(timeFilters.first)}) as first
UNION ALL
SELECT second.* FROM (${createQuery(timeFilters.second)}) as second
ORDER BY received_at DESC, sent_at DESC
`;
const [query, params] = sql`${template} LIMIT ${limit}`;