Skip to content

Breakfast @ Tiffany's#20

Open
joelamb wants to merge 37 commits intoconstructorlabs:masterfrom
joelamb:master
Open

Breakfast @ Tiffany's#20
joelamb wants to merge 37 commits intoconstructorlabs:masterfrom
joelamb:master

Conversation

@joelamb
Copy link

@joelamb joelamb commented Oct 16, 2018

No description provided.

if (menuItems.length != 0) {
res.json(menuItems);
} else {
res.status(404).json({ error: 'Sorry, there are no items on the menu' });
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

const ordersKeys = Object.keys(orders.customerOrders);
const id = ordersKeys.length > 0 ? Math.max(...ordersKeys) + 1 : 1;
orders.customerOrders = Object.assign({}, orders.customerOrders, {
[id]: order
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put the id property on the order itself, so you can know the id even when order object is outside of collection

@dmitrigrabov
Copy link
Contributor

Great work

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