I have a method that is trying to chain together 3 requests like this:
showProfileDetails() {
this.getUserInfo(this.currentUser.id).pipe(
mergeMap(e =>
this.getAccounts(this.currentUser.id)
),
mergeMap(e =>
this.getPayments(this.currentUser.id)
)
).subscribe(data =>
console.log('first attempt on observables: ', data)
)
}
My goal is to fetch the data from each call sequentially, store it in a variable, and then display it on the web page. However, I am only getting the data from the last call, which also happens to return an error. How can I handle this error without interrupting the process? Thank you for your help, as I am new to Angular.