Skip to content
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 button deletes item from list and firebase after user confirma… #49

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

granolagabrielle
Copy link
Collaborator

Description

This code renders a delete button for each list item. Once the user clicks the button, the app prompts them to confirm that they want to delete the item. Once approved, the item is removed from the list and the database.

Related Issue

closes #12

Acceptance Criteria

  • The ListItem component renders a button that allows the user to delete an item from their list when clicked
  • Clicking the delete button prompts the user to confirm that they really want to delete the item
  • The deleteItem function in api/firebase.js has been filled out, and deletes the item from the Firestore database

Type of Changes

enhancement

Updates

Before

Screenshot 2024-09-16 at 6 07 19 PM

After

Screenshot 2024-09-16 at 6 06 21 PM
Screenshot 2024-09-16 at 6 06 37 PM

Testing Steps / QA Criteria

  1. Click the delete button next to an item
  2. Select "Ok" from the alert to confirm delete for that item
  3. Check firebase to ensure the item was deleted
  4. Also select "cancel" to ensure the item stays in the list

Copy link

github-actions bot commented Sep 16, 2024

Visit the preview URL for this PR (updated for commit 58047e3):

https://tcl-75-smart-shopping-list--pr49-gb-nk-delete-item-vgf3jdm3.web.app

(expires Wed, 25 Sep 2024 18:00:24 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1f1fd53c369e1fa31e15c310aa075b4e8f4f8dde

@kweeuhree kweeuhree added the enhancement New feature or request label Sep 17, 2024
Copy link
Collaborator

@warrenchan13 warrenchan13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one comment. Other than that, it looks good!

@@ -25,7 +25,7 @@ export function List({ data }) {
<p>Welcome to {listName}!</p>
<p>Ready to add your first item? Start adding below!</p>

<AddItems />
<AddItems items={items} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on the failed test, i think you need to import items to use it as a prop for the AddItems component

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey! thank you for catching that! i forgot to push the last changes, i think that this was breaking our deployed app, so i added this change

Copy link
Sponsor Member

@deeheber deeheber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me and passes all of the acceptance criteria. Tested locally and on the deployed versions.

Going to let this PR sit for a little to see if another mentor also wants to review to get you extra feedback. Otherwise, I'll merge this end of day tomorrow (Sept 19). Let me know if you don't want that to happen.

@deeheber deeheber merged commit 7fbda4a into main Sep 19, 2024
4 checks passed
@deeheber deeheber deleted the gb-nk-delete-item branch September 19, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants