Answer the question
In order to leave comments, you need to log in
How to correctly execute several queries in a row based on the data received from the previous one?
There is one request:
useEffect(() => {
const loadData = async () => {
await http.get(`/product/${id}/modification`, {
params: {query},
})
.then((data) => {
console.log('data', data);
})
.catch((error) => {
console.log('error', error);
});
};
loadData();
}, []);
Answer the question
In order to leave comments, you need to log in
why is there then at all if async/await is used?
if not a loop, then it works like this:
await http.get(`/product/${id}/modification`, {
params: {query},
})
await http.get(`/product/${id} /modification`, {
params: {query},
})
await http.get(`/product/${id}/modification`, {
params: {query},
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question