uploadImage(extraFileItems[i])
.then(response =>
console.log(response)
);
// addItemToBin(bin, name, url);
I'm calling a function here that fetches data from an API. The API returns a promise with a result of what I want to pass as the "URL" parameter in the "addItemToBin" function. How can I call the "addItemToBin" function and pass it an argument of the promise result in the uploadImage function call?
I tried taking the response and setting it to a variable called url, however, that doesn't work. I also tried just calling the "addItemToBin" function in the .then however, that doesn't work either.