feat: add user search functionality
- Implemented `GET /users/search` endpoint in the backend to enable user search by username or display name. - Added `search` method in `UsersService` and `UsersRepository`. - Updated frontend `UserService` to support the new search API.
This commit is contained in:
@@ -106,6 +106,16 @@ export class UsersService {
|
||||
};
|
||||
}
|
||||
|
||||
async search(query: string) {
|
||||
const users = await this.usersRepository.search(query);
|
||||
return users.map((user) => ({
|
||||
...user,
|
||||
avatarUrl: user.avatarUrl
|
||||
? this.s3Service.getPublicUrl(user.avatarUrl)
|
||||
: null,
|
||||
}));
|
||||
}
|
||||
|
||||
async findOne(uuid: string) {
|
||||
const user = await this.usersRepository.findOne(uuid);
|
||||
if (!user) return null;
|
||||
|
||||
Reference in New Issue
Block a user