perf(api,frontend): index hot queries, paginate chats, fix realtime
This commit is contained in:
@@ -99,10 +99,19 @@ export function logoutAccount(accountId: number): Promise<void> {
|
||||
return request<void>(`/accounts/${accountId}`, { method: "DELETE" });
|
||||
}
|
||||
|
||||
export function listChats(page: Page = {}): Promise<Chat[]> {
|
||||
interface ChatPage extends Page {
|
||||
folder_id?: number;
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export function listChats(page: ChatPage = {}): Promise<Chat[]> {
|
||||
return request<Chat[]>("/chats", { account: true, query: { ...page } });
|
||||
}
|
||||
|
||||
export function getChat(chatId: number): Promise<Chat | null> {
|
||||
return request<Chat | null>(`/chats/${chatId}`, { account: true });
|
||||
}
|
||||
|
||||
export function listFolders(): Promise<Folder[]> {
|
||||
return request<Folder[]>("/folders", { account: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user