import { http } from "./http"; import type { AuthUser, UserSearchItem } from "../chat/types"; export async function searchUsers(query: string, limit = 20): Promise { const { data } = await http.get("/users/search", { params: { query, limit } }); return data; } interface UserProfileUpdatePayload { name?: string; username?: string; bio?: string | null; avatar_url?: string | null; } export async function updateMyProfile(payload: UserProfileUpdatePayload): Promise { const { data } = await http.put("/users/profile", payload); return data; } export async function getUserById(userId: number): Promise { const { data } = await http.get(`/users/${userId}`); return data; }