Date: Wed, 11 Oct 2023 23:11:08 +0100
Subject: [PATCH 6/6] 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 7a55cd09..e236b8a3 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)}