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. */
|
/** Combine filter queries into a single union query. */
|
||||||
function getFiltersQuery(filters: DittoFilter[]) {
|
function getFiltersQuery(filters: DittoFilter[]) {
|
||||||
return filters
|
return filters
|
||||||
.map(getFilterQuery)
|
.map((filter) => db.selectFrom(() => getFilterQuery(filter).as('events')).selectAll())
|
||||||
.reduce((result, query) => result.union(query));
|
.reduce((result, query) => result.unionAll(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get events for filters from the database. */
|
/** Get events for filters from the database. */
|
||||||
|
|
Loading…
Reference in New Issue