promises_problem

by upigilam

JavaScript

// can you modify it so that it will?
function getUserThumbnail(id) {
  fetch(`/users/${id}`).then(function(profile) {
    fetch(`/thumbnails/${profile.thumbnailId}`).then(function(thumbnail) {
        return thumbnail
    })
  })
}

// here's how it will be used
getUserThumbnail(123).then(function(thumbnail) {
   console.log(thumbnail)
})