mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
fix: prevent conditions overlapping by adding parenthesis to search condition
This commit is contained in:
@ -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 } =
|
||||||
|
Reference in New Issue
Block a user