Update index.ts

This commit is contained in:
Classic298 2025-06-21 13:56:09 +02:00 committed by GitHub
parent 4cd0119fd1
commit 05ffb9363f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,8 @@ import { getTimeRange } from '$lib/utils';
export const createNewChat = async (token: string, chat: object) => {
let error = null;
const { folder_id, ...chatData } = chat as any;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/new`, {
method: 'POST',
headers: {
@ -12,7 +14,8 @@ export const createNewChat = async (token: string, chat: object) => {
authorization: `Bearer ${token}`
},
body: JSON.stringify({
chat: chat
chat: chatData,
...(folder_id && { folder_id: folder_id })
})
})
.then(async (res) => {