Skip to content
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

weekend za delivereat #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

zuberman
Copy link

No description provided.

@zuberman
Copy link
Author

sorry I forgot to write my readme!

fetch(`/order`, {method:"POST", headers: {
"Content-Type": "application/json; charset=utf-8",
}, body: JSON.stringify(this.state.order)})
this.setState({
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to put setState inside a then so you can ensure that the POSTt has completed successfully

this.props.receiveOrderSubmit();
}

handleClick2(id){
Copy link
Contributor

Choose a reason for hiding this comment

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

this could have a more descriptive name

},
};

const orders = {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would better to initialise orders as an empty object, otherwise we end up a with a dodgy first order

@dmitrigrabov
Copy link
Contributor

Great stuff. Would be good to see a README and more frequent commits

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