Marvin
11/21/2023, 2:23 AMvar userProfile = container.getComponent('UserProfile');
userProfile.getCustomerSegments().then(function(customerSegments) {
console.debug({customerSegments});
}).fail(function(reason) {
console.debug({reason});
});
on shopping returns the following error:
Cannot read properties of undefined (reading 'map')
on my_account it returns successfully:
{
"customerSegments": [
{
"id": -1,
"name": "-- ALL USERS --"
},
{
"id": -3,
"name": "-- RECOGNIZED AND LOGGED-IN CUSTOMERS --"
},
{
"id": 7413,
"name": "PCV: Food Pantry NE USDA"
}
]
}
Steve Goldberg
11/21/2023, 10:50 AMuserProfile.getUserProfile().then( ... your code here ...)
Shopping doesn't need to wait for the user profile promise to resolve for it to load but the my account application does, which would explain why the my account application works fine.Marvin
11/21/2023, 8:28 PMSteve Goldberg
11/22/2023, 9:34 AM