I have this function
const totalJueces = async(id, idPost) => {
try{
const res = await axios(`${process.env.REACT_APP_PJUD_URLBASE}agenda/fullList/${id}/${idPost}`, { 'timeout': 30000 })
console.log(res.data.listaJuecesAsignadosCausa.length)
}
catch(error){
console.log(error)
}
}
If I console.log(res.data.listaJuecesAsignadosCausa.length)
it's actually giving me the correct response, in this case an integer (I need to know the specific number of arrays in that request)
But If I try to use this function with a return, it returns a Promise pending.
How can I use the correct number to use it as a dynamic parameter in a loop of items?