Fix conditions
This commit is contained in:
parent
ff9d934f87
commit
e536ec5093
|
@ -465,20 +465,16 @@ class InternalBuilder {
|
|||
|
||||
if (filters.$and) {
|
||||
const { $and } = filters
|
||||
query = query.where(x => {
|
||||
for (const condition of $and.conditions) {
|
||||
x = this.addFilters(x, condition, opts)
|
||||
query = query.andWhere(b => this.addFilters(b, condition, opts))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (filters.$or) {
|
||||
const { $or } = filters
|
||||
query = query.where(x => {
|
||||
for (const condition of $or.conditions) {
|
||||
x = this.addFilters(x, { ...condition, allOr: true }, opts)
|
||||
query = query.orWhere(b => this.addFilters(b, condition, opts))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (filters.oneOf) {
|
||||
|
|
Loading…
Reference in New Issue