Skip to content

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