refac/enh: include foldered chats in ref chat input menu
This commit is contained in:
@@ -77,7 +77,11 @@ export const importChat = async (
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getChatList = async (token: string = '', page: number | null = null) => {
|
||||
export const getChatList = async (
|
||||
token: string = '',
|
||||
page: number | null = null,
|
||||
include_folders: boolean = false
|
||||
) => {
|
||||
let error = null;
|
||||
const searchParams = new URLSearchParams();
|
||||
|
||||
@@ -85,6 +89,10 @@ export const getChatList = async (token: string = '', page: number | null = null
|
||||
searchParams.append('page', `${page}`);
|
||||
}
|
||||
|
||||
if (include_folders) {
|
||||
searchParams.append('include_folders', 'true');
|
||||
}
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/?${searchParams.toString()}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
const getItemsPage = async () => {
|
||||
itemsLoading = true;
|
||||
let res = await getChatList(localStorage.token, page).catch(() => {
|
||||
let res = await getChatList(localStorage.token, page, true).catch(() => {
|
||||
return [];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user