enh: folder export

This commit is contained in:
Timothy J. Baek
2024-10-19 02:42:12 -07:00
parent 3c1afa97af
commit 7d322a7238
9 changed files with 148 additions and 140 deletions

View File

@@ -243,6 +243,37 @@ export const getChatListBySearchText = async (token: string, text: string, page:
}));
};
export const getChatsByFolderId = async (token: string, folderId: string) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/folder/${folderId}`, {
method: 'GET',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...(token && { authorization: `Bearer ${token}` })
}
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.then((json) => {
return json;
})
.catch((err) => {
error = err;
console.log(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const getAllArchivedChats = async (token: string) => {
let error = null;