From 18debfb0fe6d56a44d3324048dd43dca910cdb1a Mon Sep 17 00:00:00 2001 From: sp mac bookpro 2605 Date: Mon, 8 Jun 2026 01:51:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dbuild=E9=94=99?= =?UTF-8?q?=E8=AF=AF(attachments=E7=B1=BB=E5=9E=8B=E4=B8=8EswitchBranch?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/chat.ts | 2 ++ src/pages/chat/components/ChatInput.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/chat.ts b/src/api/chat.ts index c3f5686..66eb5dc 100644 --- a/src/api/chat.ts +++ b/src/api/chat.ts @@ -58,6 +58,8 @@ export const ChatAPI = { imageUrls }) .then((r) => r.data), + switchBranch: (agentId: string, userMsgId: string, branchId: string) => + api.post(`/agents/${agentId}/messages/${userMsgId}/branches/${branchId}/switch`).then((r) => r.data), clear: (roomId: string) => api.delete(`/rooms/${roomId}/messages`).then((r) => r.data) }; diff --git a/src/pages/chat/components/ChatInput.tsx b/src/pages/chat/components/ChatInput.tsx index 0c15144..f90bd26 100644 --- a/src/pages/chat/components/ChatInput.tsx +++ b/src/pages/chat/components/ChatInput.tsx @@ -11,7 +11,7 @@ export default function ChatInput(props: { setInput: (v: string) => void; sending: boolean; attachments: ChatAttachment[]; - setAttachments: (updater: (prev: ChatAttachment[]) => ChatAttachment[]) => ChatAttachment[]; + setAttachments: (updater: (prev: ChatAttachment[]) => ChatAttachment[]) => void; imageUrls: string[]; setImageUrls: (updater: (prev: string[]) => string[]) => void; onSend: () => void;