I have an array of strings ['string1', 'string2']
and I want to transform each one of them into (example: blob:http://something-new
) but i get a result of (2) [Promise, Promise]
. How to get the resolved value?
here is the code
const results = id.map(async assetId => {
const responseIds = await API.assets.getAssetFileById(assetId);
let asset = responseIds.data.asset;
const urlCreator = window.URL || window.webkitURL;
const blobFile = await file_helper.dataUrlToBlob(asset.file);
return asset.file = await urlCreator.createObjectURL(blobFile);
});
console.log(results) // (2) [Promise, Promise]
Expected output:
console.log(results) // (2) ['blob:http://something-new1', 'blob:http://something-new2']