Im working with axio in my nodejs code. the fetch are working fine but im wondering if it could be improve. I know that axios works with async but im yet to understand it fondly. any feedback on the below code??
let list =[]
let list1=[]
const id = await axios.get('http://localhost:8080/empleado/byUsuarioEmpleado/'+ request.body.username).then((res =>{
console.log(res.data[0].id)
list = axios.get ('http://localhost:8080/rol/rolid/'+ res.data[0].id).then((res =>{
console.log(res.data)
for (let todo of res.data){
console.log(todo.idrolPago)
list1.push(axios.get ('http://localhost:8080/transaccion/idtrans/'+ todo.idrolPago).then((res =>{
console.log(res.data)
})))
}
}))
}))