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

88
Views
Devuelve la obtención de datos en lugar de la promesa pendiente

Tengo problemas para devolver datos reales en lugar de solo una promesa pendiente. Intenté resolver las promesas usando Promise.resolve , pero no tuve suerte. Aquí está el código:

índice.js

 const results = segments.map(async (segment) => { let result = await getMember(segment, customer.email) return result; });

otroArchivo.js

 export default async function getMember(segment, email) { let response = await fetch( `${process.env.KLAVKIYO_API_URL}segment/${segment}/get-members?api_key=${process.env.KEY}`, { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json", }, body: JSON.stringify({ emails: email, }), } ); let customer = await response.json(); if (Array.isArray(customer)) { return customer[0]; } }

Realmente agradecería cualquier ayuda aquí. ¡Gracias!

about 4 years ago · Juan Pablo Isaza
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!