I require assistance with the user function below:
getUser(uuid: string): Observable<WowUserDataModel> {
let user: WowUserDataModel = {
login: null,
userUuid: uuid,
firstName: null,
lastName: null,
displayName: null,
email: null,
authorities: null
};
return this.http.get(WowUrlProvider.gateway.wowUserAuthorities.replace('{userUuid}', uuid.toUpperCase())).pipe(
map((authorities) =>
user.authorities = authorities,
)
);
}
My Requirement: I need to wait for the completion of the this.http.api call, which returns an Observable. Once the call is complete, I want to assign the result to user.authorities before returning an Observable containing the entire user object (always a single user).
Current Issue: The function only returns the authorities property and not the entire user object.
Is there a way to achieve this without changing the return type of the function?