After receiving the code, I am attempting to extract a combined value from two HTTP calls
defer(() => {
return this.service.save1(data)
.pipe(
concatMap((result) => {
if (result) {
return of({
...result,
c: this.service.save2(result.id , this.obj).subscribe()
})
}
return of({});
}),
catchError(err => throwError(err)),
}).subscribe((result) => {
if (result) {
console.log(result);
}
},
In the console.log(result), we now have the complete object result with additional data under c: My goal is to include all fields returned by the initial call along with c: as an array of objects