Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ASPhillips8
Copy link

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
Screenshot 2024-06-17 at 3 35 22 PM

Copy link

@stephenmckeon stephenmckeon left a 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.

Comment on lines 3 to 5
function Item({ item, onUpdateItem, onDeleteItem }) {

function handleAddToCart() {

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!

Suggested change
function Item({ item, onUpdateItem, onDeleteItem }) {
function handleAddToCart() {
function Item({ item, onUpdateItem, onDeleteItem }) {
function handleAddToCart() {

Comment on lines 11 to 12
body: JSON.stringify({isInCart: !item.isInCart
}),

Choose a reason for hiding this comment

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

Suggested change
body: JSON.stringify({isInCart: !item.isInCart
}),
body: JSON.stringify({ isInCart: !item.isInCart }),

Comment on lines +3 to 4
function ItemForm({ onAddItem }) {
const [name, setName] = useState("");

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!

}

function handleAddItems(newItem) {
console.log("in Shopping", newItem)

Choose a reason for hiding this comment

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

Suggested change
console.log("in Shopping", newItem)

@ASPhillips8
Copy link
Author

Sent updated code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants