From c969e9c014cebc7aef3068e15486c547fe663140 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 11 Oct 2023 23:11:08 +0100 Subject: [PATCH] fix update and delete bug --- frontend/src/Navigation.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 7a55cd0..e236b8a 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -88,12 +88,6 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { method: 'POST', }) .then(() => { - // remove the image element from the DOM - const imageElement = document.querySelector( - `#img-${id}`, - ) as HTMLElement; - const parentElement = imageElement.parentNode as HTMLElement; - parentElement.parentNode?.removeChild(parentElement); fetchConversations(); }) .catch((error) => console.error(error)); @@ -239,9 +233,9 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
{conversations - ? conversations.map((conversation, index) => ( + ? conversations.map((conversation) => ( handleConversationClick(id)} onDeleteConversation={(id) => handleDeleteConversation(id)}