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:
Mathis HERRIOT
2026-01-29 15:47:03 +01:00
parent 2c18fd1c1a
commit f852835c59
4 changed files with 39 additions and 1 deletions

View File

@@ -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;