I'm attempting to make a call to an outside service. The call seems to go through successfully, but all I get returned is a Promise, and if I access a property, it returns another Promise. Would appreciate another set of eyes to see what I'm doing wrong (I'm a Java developer writing React for the first time).
function retrieveUserProfile() {
const result = API.fetchProfile({
include: 'field1, field2',
});
return result;
}
let userProfile = retrieveUserProfile()
.then((result) => {
return result.data;
})
userProfile
is yet another promise. Any ideas? Please let me know if you need more context.