Update first element array

pull/16/head
ayshiff 2018-06-05 18:49:36 +02:00
parent 7fe68ec2ed
commit 3b3260cc78
1 changed files with 5 additions and 2 deletions

View File

@ -50,8 +50,11 @@ class App extends Component {
componentWillMount(){
if(this.state.start === true) {
this.fetchQuestion(this.state.baseRoute+"/questions/1");
this.fetchResponses(this.state.baseRoute+"/questions/1/responses");
axios.get(this.state.baseRoute+"/questions")
.then(((data) => {
this.fetchQuestion(this.state.baseRoute+"/questions/"+data.data[0].id);
this.fetchResponses(this.state.baseRoute+"/questions/"+data.data[0].id+"/responses");
}))
this.setState ({
start: false
})