-
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
Dc el delete items #28
Conversation
Visit the preview URL for this PR (updated for commit b694788): https://tcl-78-smart-shopping-list--pr28-dc-el-delete-items-817nxxwp.web.app (expires Thu, 26 Sep 2024 16:52:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c781903507c1507075d7a974036959ddeec29c0a |
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.
Excellent work done guys. It works as expected 👌🏾. And whooooo, y'all's speed was something else 😅🔥
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.
Well done team!, your feature works mostly.💥
but when I have an internet issue and my delete request could not be completed, I don't see an error message saying why. That will def reduce the users' experience on our app.
I left a suggestion on how you can go about it😊. Let me know if you have any questions!
src/api/firebase.js
Outdated
} catch (error) { | ||
console.log(error); | ||
} |
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.
you can throw the error here and catch it in the component where you are calling deleteItem for appropriate handling
src/views/List.jsx
Outdated
} catch (error) { | ||
console.error('Failed to delete the item', error); | ||
} |
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.
you already have a system of error management from your past issues, you can use it here to show the user an error message. it is always good for a developer to show a good error message to a user as to why an action could not be completed.
Well done! The item deletion works well for me :) Congrats on the speediest issue yet! |
} catch (error) { | ||
console.error(error.message, error); | ||
setErrorMsg('Failed to delete the item. Please try again!'); |
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.
great! well done team!!😊💥
Description
A delete button is rendered next to each item in a list. When clicked, the item is deleted from the database.
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
new feature
Updates
Updated UI with rendered delete buttons and pop up window
Testing Steps / QA Criteria