Skip to content

Commit

Permalink
fix update and delete bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpain committed Oct 11, 2023
1 parent 344692f commit c969e9c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions frontend/src/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -239,9 +233,9 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
</NavLink>
<div className="conversations-container max-h-[25rem] overflow-y-auto">
{conversations
? conversations.map((conversation, index) => (
? conversations.map((conversation) => (
<ConversationTile
key={index}
key={conversation.id}
conversation={conversation}
selectConversation={(id) => handleConversationClick(id)}
onDeleteConversation={(id) => handleDeleteConversation(id)}
Expand Down

0 comments on commit c969e9c

Please sign in to comment.