//this will work...
await orderDetails.map((i: any) => {
orderDetailsRow += `<div class="row">
<div class="col-sm-8">
<h2 class="service-title"><a href="">${i.productId}</h2>
<h5 class="service-subtitle">Qty:${i.qty}</h5>
</div>
</div>`;
});
//this won't
orderDetails.map(async (item) => {
let itemDetails = await Product.findById(item.productId).select([
"title",
"price",
]);
return { itemDetails, qty: item.qty };
});