Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!