[Vuejs]-Data undefined in first call?

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;
});

Leave a comment