Merge pull request #16 from SundownDEV/devFront
Update first element array in ComponentWillMountpull/17/head
commit
e10c5380f7
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue