fix search users in chat #3

Merged
Vitalik merged 1 commits from fix/search-chat-users into stage 9 months ago
  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