Improve ordering of getRecentStoryReplies

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2025-12-08 11:49:52 -06:00
committed by GitHub
parent daed0d003e
commit 81fad65193

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}`;