fix: prevent conditions overlapping by adding parenthesis to search condition

This commit is contained in:
Mhd Zayd Skaff
2025-07-09 15:39:36 +03:00
parent 09322c5b80
commit 30a8ae3bd2

View File

@ -52,7 +52,7 @@ export class BookableSpaceService {
if (search) { if (search) {
qb = qb.andWhere( qb = qb.andWhere(
'space.spaceName ILIKE :search OR community.name ILIKE :search OR parentSpace.spaceName ILIKE :search', '(space.spaceName ILIKE :search OR community.name ILIKE :search OR parentSpace.spaceName ILIKE :search)',
{ search: `%${search}%` }, { search: `%${search}%` },
); );
} }
@ -68,7 +68,6 @@ export class BookableSpaceService {
.leftJoinAndSelect('space.bookableConfig', 'bookableConfig') .leftJoinAndSelect('space.bookableConfig', 'bookableConfig')
.andWhere('bookableConfig.uuid IS NULL'); .andWhere('bookableConfig.uuid IS NULL');
} }
const customModel = TypeORMCustomModel(this.spaceRepository); const customModel = TypeORMCustomModel(this.spaceRepository);
const { baseResponseDto, paginationResponseDto } = const { baseResponseDto, paginationResponseDto } =