-
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
Rt el add new item #21
Conversation
…and next purchase number
…n handleSubmit with listPath value
Visit the preview URL for this PR (updated for commit 14f61a1): https://tcl-78-smart-shopping-list--pr21-rt-el-add-new-item-yw6hapaf.web.app (expires Fri, 30 Aug 2024 15:50:13 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c781903507c1507075d7a974036959ddeec29c0a |
Hey guys, the form works ok, but when I try to create a new list, it returns an error message "Failed to add the item to the list". I consoled it and it seems the error comes from the function which adds the new list to the database. The "addItem" function seems to be taking an empty path which returns the error when trying to create a new list item. Check it out |
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.
Just make sure the "listPath" parameter to the "addItem" function takes an actual path. Aside from that, everything else looks ok
Description
In the ManageList view we implemented a form where the user can sumbit a new item that will be saved into the current shopping list.
In firebase.js we implemented a firebase/firestore method addDoc to save a new item into the database, as instructed by the documentation.
Related Issue
Closes #5
Acceptance Criteria
UI-related tasks:
ManageList
view displays a form that allows them to enter the name of the item and select how soon they anticipate needing to buy it again. There should be 3 choices for this:label
element associated with itEnter
keyData-related tasks:
console.log
in theaddItem
function insrc/api/firebase.js
is replaced with a function that adds the new document to the Firestore database. That function will be imported from thefirebase/firestore
module.nextPurchasedDate
Type of Changes
New feature in the ManageList view
Updates
Before
After
Testing Steps / QA Criteria
Start app in the browser --> navigate to ManageList --> fill out the form --> submit
Submit the form without filing it out completely. An error message should appear.