Making sure filters are always added to end, this is important for OR situations.

This commit is contained in:
mike12345567 2024-08-15 18:52:17 +01:00
parent 48672244f4
commit a1fae4d799
1 changed files with 3 additions and 2 deletions

View File

@ -371,10 +371,11 @@ class InternalBuilder {
),
castedTypeValue.values
)
} else if (!opts?.relationship && !isRelationshipField) {
} else if (!isRelationshipField) {
const alias = getTableAlias(tableName)
fn(alias ? `${alias}.${updatedKey}` : updatedKey, value)
} else if (opts?.relationship && isRelationshipField) {
}
if (opts?.relationship && isRelationshipField) {
const [filterTableName, property] = updatedKey.split(".")
const alias = getTableAlias(filterTableName)
fn(alias ? `${alias}.${property}` : property, value)