From 2f3d9d047a3c0c3a166480f8af27e2959661eb5a Mon Sep 17 00:00:00 2001 From: Abhay Kumar Sahu <115890460+abhayksahu369@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:16:24 +0530 Subject: [PATCH] fixed delete issue (#55) --- src/components/Manager.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Manager.jsx b/src/components/Manager.jsx index 2c9e618..eb25883 100755 --- a/src/components/Manager.jsx +++ b/src/components/Manager.jsx @@ -134,8 +134,8 @@ const Manager = () => { "Do you really want to delete this password?" ); if (confirmDelete) { - setPasswordArray(passwordArray.filter((item) => item.id !== id)); - await fetch("http://localhost:3000/", { + setPasswordArray(passwordArray.filter((item) => item._id !== id)); + await fetch(`http://localhost:3000/${id}`, { method: "DELETE", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ id }), @@ -409,7 +409,7 @@ const Manager = () => { { - deletePassword(item.id); + deletePassword(item._id); }} >