enh: archived chats modal

This commit is contained in:
Timothy Jaeryang Baek
2025-05-25 00:48:30 +04:00
parent 31e2686ae6
commit 7e6f1f8848
8 changed files with 517 additions and 271 deletions
+8 -2
View File
@@ -145,10 +145,16 @@ export const getChatListByUserId = async (token: string = '', userId: string) =>
}));
};
export const getArchivedChatList = async (token: string = '') => {
export const getArchivedChatList = async (token: string = '', page: number = 1, query?: string) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/archived`, {
const searchParams = new URLSearchParams();
searchParams.append('page', `${page}`);
if (query) {
searchParams.append('query', query);
}
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/archived?${searchParams.toString()}`, {
method: 'GET',
headers: {
Accept: 'application/json',