Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

105
Vistas
I need feedback on my nodejs code working with axios

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)

              }))) 
            }


            }))

   
       }))

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda