Add conversation deletion functionality and update HistoryPage

- Implement a new API endpoint for deleting conversations in the backend.
- Enhance the HistoryPage component to include a dropdown menu for conversation actions, allowing users to delete conversations.
- Update the pagination logic to handle conversation removal and improve user experience during deletion.
- Adjust the loading state and error handling for the delete operation, ensuring smooth interaction.
This commit is contained in:
Xin Wang
2026-07-10 16:38:59 +08:00
parent 059ad8162e
commit ba59ea447c
3 changed files with 127 additions and 18 deletions

View File

@@ -249,6 +249,8 @@ export const conversationsApi = {
},
get: (id: string) =>
request<ConversationDetail>(`/api/conversations/${id}`),
remove: (id: string) =>
request<{ ok: boolean }>(`/api/conversations/${id}`, { method: "DELETE" }),
};
// ---------- 工具 ----------