I have company product packages. I need to get current company product packages. Am trying to get than like this
const packageIds = user.company.products.forEach(async (prod) => {
await prod.load('packages')
const pckgIds = prod.packages.map((packg) => packg.id)
// i can get ids in here
console.log(pckgIds)
})
// here i get undefined, how can i get here package Ids?
console.log(packageIds)
I don't understand why I get undefined in packageIds