componentDidMount() {
orderService.getAll().then(
response => {
this.setState({
currentUser: AuthService.getCurrentUser(),
content:
response.data,
user_id: AuthService.getCurrentUser().user_id,
currentLocationId: AuthService.getCurrentLocation().id,
Children: this.props.children
});
console.log(this.state.content)
},
error => {
this.setState({
content:
(error.response &&
error.response.data &&
error.response.data.message) ||
error.message ||
error.toString()
});
}
);
}
async componentDidUpdate(prevProps, prevState) {
if (prevState.isSubmitted !== this.state.isSubmitted) {
orderService.getAll().then(
response => {
this.setState({
currentUser: AuthService.getCurrentUser(),
content:
response.data,
isSubmitted: false
});
}
);
}
}