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

123
Views
Pase el segundo parámetro cuando mapee URL con axios.all

tengo una matriz que contiene un objeto con dos valores, como este:

 [ { brand: app1, url: https://myhost.com/api }, { brand: app2, url: https://otherapi.com/api } ]

Estoy usando axios.all para realizar una solicitud de obtención de todas las direcciones URL, y la itero con un mapa, como este:

 const getData= axios.all(stuffData.map((item) => axios.get(item.url))) .then(res => console.log(res.data)

La cuestión es, ¿cómo puedo pasar el segundo parámetro en la matriz cuando hago el mapa para interactuar con todas las solicitudes de axios? También necesito pasar la clave "marca".

Gracias

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Utilizar este:

 Promise.all(stuffData.map(async (item) => ({ data: await axios.get(item.url).data, brand: item.brand }))).then((data) => { data.forEach(item=> console.log(item)) })
about 4 years ago · Santiago Trujillo Report
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!