How to properly implement a double query?

methods: {
 signin() {
 // this.$root.$emit('loading', true);
axios.all([
 axios.post('auth/signin', {
 user: {
 email: this.email
 password: this.password
}
}),
 axios.get("captcha/check", {
 captcha: this.captcha
})
 ]).then(res => {
console.log(Res. data.user);
 if (res.data.success === true) {
 this.$root.$emit('loading', true);
 return this.$store.dispatch('user/auth', res.data);
June 3rd 19 at 18:55
1 answer
June 3rd 19 at 18:57
function getUserAccount() {
 return axios.get('/user/12345');
}

function getUserPermissions() {
 return axios.get('/user/12345/permissions');
}

axios.all([getUserAccount(), getUserPermissions()])
 .then(axios.spread(function (acct, perms) {
 // Both requests are now complete
 }));

Find more questions by tags Vue.js