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(){
|
componentWillMount(){
|
||||||
if(this.state.start === true) {
|
if(this.state.start === true) {
|
||||||
this.fetchQuestion(this.state.baseRoute+"/questions/1");
|
axios.get(this.state.baseRoute+"/questions")
|
||||||
this.fetchResponses(this.state.baseRoute+"/questions/1/responses");
|
.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 ({
|
this.setState ({
|
||||||
start: false
|
start: false
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue