Merge branch 'limit-fix' into 'main'

db/events: fix `limit` not being applied correctly

See merge request soapbox-pub/ditto!69
This commit is contained in:
Alex Gleason 2023-12-06 00:32:33 +00:00
commit 709675754c
1 changed files with 2 additions and 2 deletions

View File

@ -139,8 +139,8 @@ function getFilterQuery(filter: DittoFilter) {
/** Combine filter queries into a single union query. */
function getFiltersQuery(filters: DittoFilter[]) {
return filters
.map(getFilterQuery)
.reduce((result, query) => result.union(query));
.map((filter) => db.selectFrom(() => getFilterQuery(filter).as('events')).selectAll())
.reduce((result, query) => result.unionAll(query));
}
/** Get events for filters from the database. */