-
Notifications
You must be signed in to change notification settings - Fork 38
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
Kate's deliverEat #14
base: master
Are you sure you want to change the base?
Conversation
.map(eachOrder => eachOrder.price * eachOrder.number) | ||
.reduce((acc, item) => acc + item); | ||
const deliveryCost = foodCost * 0.1; | ||
const totalCost = foodCost * 1.1; |
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.
I would be better to use totalCost = foodCost + deliveryCost
to prevent logic duplication
@@ -0,0 +1,93 @@ | |||
function database() { |
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.
very nice
placedOrders: body | ||
}, | ||
() => | ||
localStorage.setItem( |
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.
Since placedOrders are stored on the server, I would suggest not storing them locally as well. Otherwise we end up with 2 sources of truth. It would better to fetch the data from the server when needed
return item; | ||
} | ||
}) | ||
.filter(item => item.number !== 0) |
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.
nice
menu: [], | ||
order: [], | ||
placedOrders: [], | ||
orderBasket: [], |
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.
it looks like orderBasket is not used and can probably be removed
Great work. I would suggest not using localStorage to store data which is also stored on server to avoid duplication. Just store everything on server and get it from there |
No description provided.