Browse Source

fix search users in chat (#3)

Reviewed-on: #3
Co-authored-by: YaroslavBerkuta <yaroslavberkuta@gmail.com>
Co-committed-by: YaroslavBerkuta <yaroslavberkuta@gmail.com>
master
YaroslavBerkuta 9 months ago committed by Vitalik Yatsenko
parent
commit
0a295b1ee2
  1. 9
      src/domain/users/services/users.service.ts

9
src/domain/users/services/users.service.ts

@ -390,8 +390,13 @@ export class UsersService implements Users.IUsersService { @@ -390,8 +390,13 @@ export class UsersService implements Users.IUsersService {
.leftJoinAndSelect('it.info', 'info')
.where(
new Brackets(subQuery => {
subQuery.where('info.firstName ILIKE :search', { search: toSearch })
subQuery.orWhere('info.lastName ILIKE :search', { search: toSearch })
subQuery
.where("info.firstName || ' ' || info.lastName ILIKE :search", {
search: toSearch,
})
.orWhere("info.lastName || ' ' || info.firstName ILIKE :search", {
search: toSearch,
})
}),
)

Loading…
Cancel
Save