From 441a6c4453da49f0bb0b5408c07175b475af74fe Mon Sep 17 00:00:00 2001 From: Chneemann Date: Sat, 5 Sep 2026 15:35:32 +0200 Subject: [PATCH] fix(chat): correct apiEndpoint routing for direct messages in ChatItem --- components/chat/ChatItem.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/chat/ChatItem.tsx b/components/chat/ChatItem.tsx index 553bba9..e17c2e9 100644 --- a/components/chat/ChatItem.tsx +++ b/components/chat/ChatItem.tsx @@ -95,10 +95,11 @@ export function ChatItem({ }, ); - // Dynamischen Endpunkt basierend auf Chat-Typ bestimmen - const apiEndpoint = isDirect - ? `/api/dm/messages/${message.id}` - : `/api/messages/${message.id}`; + // Determine the dynamic endpoint based on the chat type + const apiEndpoint = + isDirect === "dm" + ? `/api/dm/messages/${message.id}` + : `/api/messages/${message.id}`; /** * Handles the asynchronous deletion of the chat message.