fix: isolate all where clauses (#130)
This commit is contained in:
parent
22c4b3b9e2
commit
ecdf4d39b0
@ -227,13 +227,13 @@ export async function paginate<T>(
|
|||||||
for (const column of searchBy) {
|
for (const column of searchBy) {
|
||||||
search.push({ [column]: ILike(`%${query.search}%`) })
|
search.push({ [column]: ILike(`%${query.search}%`) })
|
||||||
}
|
}
|
||||||
queryBuilder = queryBuilder.andWhere(search)
|
queryBuilder = queryBuilder.andWhere(new Brackets((queryBuilder) => queryBuilder.andWhere(search)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.filter) {
|
if (query.filter) {
|
||||||
const filter = parseFilter<T>(query, config)
|
const filter = parseFilter<T>(query, config)
|
||||||
|
|
||||||
queryBuilder = queryBuilder.andWhere(filter)
|
queryBuilder = queryBuilder.andWhere(new Brackets((queryBuilder) => queryBuilder.andWhere(filter)))
|
||||||
}
|
}
|
||||||
|
|
||||||
;[items, totalItems] = await queryBuilder.getManyAndCount()
|
;[items, totalItems] = await queryBuilder.getManyAndCount()
|
||||||
|
Loading…
Reference in New Issue
Block a user