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:
commit
709675754c
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue