Don't break or conditions on nested joins

This commit is contained in:
Adria Navarro 2024-10-11 12:55:23 +02:00
parent f192a30da0
commit 2311f8aa50
1 changed files with 4 additions and 1 deletions

View File

@ -521,8 +521,11 @@ class InternalBuilder {
const [filterTableName, ...otherProperties] = key.split(".") const [filterTableName, ...otherProperties] = key.split(".")
const property = otherProperties.join(".") const property = otherProperties.join(".")
const alias = getTableAlias(filterTableName) const alias = getTableAlias(filterTableName)
return fn(q, alias ? `${alias}.${property}` : property, value) return q.andWhere(subquery =>
fn(subquery, alias ? `${alias}.${property}` : property, value)
)
} }
for (const key in structure) { for (const key in structure) {
const value = structure[key] const value = structure[key]
const updatedKey = dbCore.removeKeyNumbering(key) const updatedKey = dbCore.removeKeyNumbering(key)