refac/pref: chat import optimization
Co-Authored-By: G30 <50341825+silentoplayz@users.noreply.github.com>
This commit is contained in:
co-authored by
G30
parent
3ef7367f01
commit
a51579a84b
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user