Skip to content

Commit

Permalink
feat(#12): added comment on the handledelete function
Browse files Browse the repository at this point in the history
  • Loading branch information
stacy-tech committed Sep 17, 2024
1 parent a008115 commit 82b4ad2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions src/api/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,6 @@ export async function updateItem(
}

export async function deleteItem(listPath, itemId) {
/**
* TODO: Fill this out so that it uses the correct Firestore function
* to delete an existing item. You'll need to figure out what arguments
* this function must accept!
*/
const itemDocRef = doc(db, listPath, `items`, itemId);
await deleteDoc(itemDocRef);
}
1 change: 1 addition & 0 deletions src/components/ListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export function ListItem({
}
};

// handleDelete Function
const handleDelete = async () => {
const deleteConfirm = window.confirm(
`Are you sure you want to delete ${name}?`,
Expand Down

0 comments on commit 82b4ad2

Please sign in to comment.