Add check for filterPath length when not having m2o/a2o relation in order to add nested filters (#11768)

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Lukas Kimpel
2022-03-05 01:40:11 +01:00
committed by GitHub
parent 4af73596a7
commit 2312a0e20d

View File

@@ -347,7 +347,7 @@ export function applyFilter(
} else {
applyFilterToQuery(`${collection}.${filterPath[0]}`, filterOperator, filterValue, logical);
}
} else if (subQuery === false) {
} else if (subQuery === false || filterPath.length > 1) {
if (!relation) continue;
let pkField: Knex.Raw<any> | string = `${collection}.${