-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete Item #29
Delete Item #29
Conversation
…dow for the user upon deleting item. Filled out deleteItem function in firebase Co-authored-by: EmmaBin <[email protected]>
Visit the preview URL for this PR (updated for commit 28ab926): https://tcl-76-smart-shopping-list--pr29-mp-eb-delete-item-hsao1ss1.web.app (expires Tue, 24 Sep 2024 17:54:25 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 512b1a88be8ae05fd3e727b99332819df760271d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works properly. Nice job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I got the prompt, it deleted on the screen, and updates in firebase.
const [checked, setChecked] = useState(false); | ||
|
||
const handleDelete = async () => { | ||
try { | ||
if (window.confirm(`Are you sure you want to delete ${name}?`)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the check here :) and the use of async/await
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clean implementation. Good job!
Description
Added delete button and implemented a function. Created a confirm window for the user upon deleting item. Filled out deleteItem function in firebase
The code adds a delete button and
deleteItem
function as well as a prompt asking if the user would like to delete the item. We learned more about how our firebase db structure and layers work.Related Issue
closes #12
Acceptance Criteria
ListItem
component renders a button that allows the user to delete an item from their list when clickeddeleteItem
function inapi/firebase.js
has been filled out, and deletes the item from the Firestore databaseType of Changes
feature
After
Testing Steps / QA Criteria