refac/pref: chat import optimization

Co-Authored-By: G30 <50341825+silentoplayz@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-11-21 03:49:49 -05:00
co-authored by G30
parent 3ef7367f01
commit a51579a84b
6 changed files with 116 additions and 119 deletions
+2 -15
View File
@@ -65,15 +65,7 @@ export const unarchiveAllChats = async (token: string) => {
return res;
};
export const importChat = async (
token: string,
chat: object,
meta: object | null,
pinned?: boolean,
folderId?: string | null,
createdAt: number | null = null,
updatedAt: number | null = null
) => {
export const importChats = async (token: string, chats: object[]) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/import`, {
@@ -84,12 +76,7 @@ export const importChat = async (
authorization: `Bearer ${token}`
},
body: JSON.stringify({
chat: chat,
meta: meta ?? {},
pinned: pinned,
folder_id: folderId,
created_at: createdAt ?? null,
updated_at: updatedAt ?? null
chats
})
})
.then(async (res) => {