Some checks failed
CI / test (push) Failing after 22s
- add user last_seen_at with alembic migration and persist on realtime disconnect - extend chat serialization with private online/last_seen, group members/online, channel subscribers - add Redis batch presence lookup helper - update web chat list/header to display status counters and last-seen labels - improve delivery receipt handling using last_delivered/last_read boundaries - include chat info panel and related API/type updates
27 lines
777 B
TypeScript
27 lines
777 B
TypeScript
import { http } from "./http";
|
|
import type { AuthUser, UserSearchItem } from "../chat/types";
|
|
|
|
export async function searchUsers(query: string, limit = 20): Promise<UserSearchItem[]> {
|
|
const { data } = await http.get<UserSearchItem[]>("/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<AuthUser> {
|
|
const { data } = await http.put<AuthUser>("/users/profile", payload);
|
|
return data;
|
|
}
|
|
|
|
export async function getUserById(userId: number): Promise<AuthUser> {
|
|
const { data } = await http.get<AuthUser>(`/users/${userId}`);
|
|
return data;
|
|
}
|