-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Code Along For Crud #12
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
base: main
Are you sure you want to change the base?
Code Along For Crud #12
Conversation
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.
This is great work (besides the extra line :P)! It's not the end of the world, but PLEASE try to make sure you're giving yourself a code review before you submit your work to me. I expect the code to be in a "production ready" state by the time it gets to me. I won't make you go back this time, but going forward, I will. Regardless, the concepts are there and you're doing an awesome job. Keep it up! And don't let the little things ruin all that hard work.
src/components/Item.js
Outdated
function Item({ item, onUpdateItem, onDeleteItem }) { | ||
|
||
function handleAddToCart() { |
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 do this in almost every lab!! PLEASE PLEASE PLEASE PLEASE PLEASE try to get out of this habit. I'm going to make you go back and delete these lines until you you stop... sorry!
function Item({ item, onUpdateItem, onDeleteItem }) { | |
function handleAddToCart() { | |
function Item({ item, onUpdateItem, onDeleteItem }) { | |
function handleAddToCart() { |
src/components/Item.js
Outdated
body: JSON.stringify({isInCart: !item.isInCart | ||
}), |
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.
body: JSON.stringify({isInCart: !item.isInCart | |
}), | |
body: JSON.stringify({ isInCart: !item.isInCart }), |
function ItemForm({ onAddItem }) { | ||
const [name, setName] = useState(""); |
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.
See, this is what I'm looking for!
src/components/ShoppingList.js
Outdated
} | ||
|
||
function handleAddItems(newItem) { | ||
console.log("in Shopping", newItem) |
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.
console.log("in Shopping", newItem) |
Sent updated code |
Used used Effect to code along with lab to handle CRUD application. Used get to fetch item data and display list. Used POST to add new items to list. Used POST to update data base on if item was in cart. Used Delete to remove item from shopping list
