1 回答

TA貢獻1934條經驗 獲得超2個贊
您返回的是 aSubscription而不是流,因為您有一個.subscribe打印結果的內部。
您應該將結果通過管道傳遞給tap操作并在那里打印,因為tap不會修改返回的流。
sendEcheq(patientId: string) {
if (this.sendEcheq.length > 0) {
of (this.echeqsToSend)
.pipe(
mergeMap(echeqsToSend =>
forkJoin(
echeqsToSend.map((echeqFamily) =>
this.echeqSubmissionMedicalService.createSubmissionBatch(1, {
echeqFamilies: [
echeqFamily.family
],
participants: [
patientId
]
}).pipe(
tap(result => console.log(reslult))
)
)
)
)
).subscribe(
result => {
this.dialog.close();
this.snackBar.open('De vcheq(s) zijn verstuurd', 'Ok');
},
error => {
console.error('Server error when assigning vcheq', error);
this.snackBar.open('Er ging iets mis bij het opsturen, probeer het later nog een keer', 'Ok');
this.dialog.close();
}
);
}
}
添加回答
舉報