Implement delete chat with confirmation dialog

This commit is contained in:
2025-07-20 19:54:10 +02:00
parent 3d7ba68511
commit c5e72d5708
4 changed files with 226 additions and 4 deletions

View File

@@ -39,6 +39,22 @@ class ChatService {
}
}
async deleteChat(chatId) {
try {
const response = await fetch(`/api/v1/conversations/${chatId}`, {
method: "DELETE",
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
return true
} catch (error) {
console.error("Error removing chat:", error)
toast.error("Could not removing chat")
throw error
}
}
async getChatMessages(chatId) {
try {
const response = await fetch(`/api/v1/conversations/${chatId}/messages`)