Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const peopleAPI = people => Promise.all(people.map(empid => {
  2.   return fetch(`https://someApiCall/${empid}`)
  3.     .then(res => res.json()).then(res => ({
  4.       empid: res.id,
  5.       name: res.name.preferred ? res.name.preferred : res.name.full
  6.     }));
  7. }));
  8.  
  9. export default peopleAPI;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement