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:
@@ -12,6 +12,13 @@ export const UserService = {
|
||||
return data;
|
||||
},
|
||||
|
||||
async search(query: string): Promise<User[]> {
|
||||
const { data } = await api.get<User[]>("/users/search", {
|
||||
params: { q: query },
|
||||
});
|
||||
return data;
|
||||
},
|
||||
|
||||
async updateMe(update: Partial<User>): Promise<User> {
|
||||
const { data } = await api.patch<User>("/users/me", update);
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user