0👍
try this :
filteredProduct = filteredProduct.map(async (item) => {
const fullData = (await SupplierService.get(item._id)).data;
item.supplier.cutoff = fullData.cutoff;
return item;
});
return filteredProduct;
or simply
return filteredProduct.map(async (item) => {
const fullData = (await SupplierService.get(item._id)).data;
item.supplier.cutoff = fullData.cutoff;
return item;
});
Source:stackexchange.com