Problem is that (this.form.tasks neither other data) cannot be found in the promise then() with axios.all. Outside the promise it works but not inside. I get the error :
Uncaught (in promise) TypeError: Cannot read property 'form' of null
axios.all([
axios.get('/tasks/'+this.token_proj),
axios.get('/keywords/'+this.token_proj),
axios.get('/getTasks/'+this.token_proj),
axios.get(`/discussion/${this.token_proj}/${this.form.page}`)
])
.then(axios.spread(function (tasksResponse, keywordsResponse,getTasksResponse,discResponse) {
console.log('tasks', tasksResponse.data);
console.log('keyword', keywordsResponse.data);
console.log('getrask', getTasksResponse.data);
console.log('disc', discResponse.data);
this.form.tasks = tasksResponse.data;
}));
The tasks variable is set in data and exist. I use Vuejs and axios vform.
data(){
return{
form: new Form({
tasks:[],
tasks_management:[],
discuss:{},
users:[],
keywords:[],
})
}
}