Skip to content

Commit

Permalink
fixed delete issue (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhayksahu369 authored Oct 7, 2024
1 parent 1b18c32 commit 2f3d9d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand Down Expand Up @@ -409,7 +409,7 @@ const Manager = () => {
<span
className="cursor-pointer mx-1"
onClick={() => {
deletePassword(item.id);
deletePassword(item._id);
}}
>
<lord-icon
Expand Down

0 comments on commit 2f3d9d0

Please sign in to comment.