From 05ffb9363f3130832a2bad156aa5f55d683a4b01 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 21 Jun 2025 13:56:09 +0200 Subject: [PATCH] Update index.ts --- src/lib/apis/chats/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/apis/chats/index.ts b/src/lib/apis/chats/index.ts index 9d24b3971..f3a1c1999 100644 --- a/src/lib/apis/chats/index.ts +++ b/src/lib/apis/chats/index.ts @@ -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) => {