How can i make nested axios call? I need to pass the result of first axios call as parameter to second axios
You can chain just like a normal promise. Fire off the next request in the .then
of the first request and then return that promise so you'll have a .then
for you second request.
axios.get(...)
.then((response) => {
return axios.get(...); // using response.data
})
.then((response) => {
console.log('Response', response);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With