Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async findUsers(options: any): Promise<UserDTO[]> {
- const foundUsers: User[] = await this.usersRepository.find({
- where: { username: Like(`%${options.keyword || ''}%`) },
- order: { username: options.order === 'DESC' ? 'DESC' : 'ASC' },
- take: options.take || 10,
- skip: options.skip || 0,
- });
- return foundUsers.map((u: User) => this.mapper.toUserDTO(u));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement