db/events: fix `limit` not being applied correctly
This commit is contained in:
parent
df7b999bfe
commit
a6bf5f47cd
|
@ -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