chore: align query count with template limit

This commit is contained in:
Cory Dransfeldt 2024-10-12 20:19:47 -07:00
parent ff3f538171
commit d213d4380a
No known key found for this signature in database
4 changed files with 19 additions and 5 deletions

View file

@ -99,5 +99,11 @@ WITH syndication_data AS (
FROM optimized_movies m
)
SELECT json_agg(syndication_data.* ORDER BY syndication_data.content_date DESC) AS syndication
FROM syndication_data;
SELECT json_agg(limited_data.*) AS syndication
FROM (
SELECT *
FROM syndication_data
WHERE syndication IS NOT NULL
ORDER BY content_date DESC
LIMIT 20
) AS limited_data;