mirror of
https://github.com/open-webui/open-webui
synced 2025-06-22 18:07:17 +00:00
Update index.ts
This commit is contained in:
parent
4cd0119fd1
commit
05ffb9363f
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user