-
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
DeliverEat project, now a normal bakery as opposed to original theme. #8
base: master
Are you sure you want to change the base?
Conversation
|
||
app.post("/api/messages", function(req, res) { | ||
console.log(req.body); | ||
let messageID = `Message${messID}`; |
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 just use the messID
as id rather than prepend Message
string to it
}); | ||
|
||
app.delete("/api/orders/:id", (req, res) => { | ||
delete orders[req.params.id]; |
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
total = Math.floor(total + newOrder[key].ownTotal); | ||
} | ||
} | ||
total += 2.4; |
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.
The order charge would better off being defined in a variable. This was it will be clearer what 2.4 refers to for someone who is not familiar with the code since the variable name will provide a hint
.then(data => { | ||
console.log("handleClick"); | ||
|
||
self.props.receiveUpdateOrder(data); |
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 can use this
here instead of self since it is an arrow function
}; | ||
console.log(result); | ||
if ( | ||
this.state.newMess.length > 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.
I suspect the entire condition can be rewritten as if(this.state.newMess.length && this.state.newAuthor.length)
. If it's a string it will have the length property and we can take advantage of the fact that if length is greater than zero, it will be truthy
} | ||
|
||
render() { | ||
setTimeout(() => console.log("Hello"), 4000); |
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.
Is this needed?
majority of tasks completed including GET, POST, DELETE fetch requests. Added a review page to home screen also using REST API. Had a lot of fun on this project 😎