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();
}
);
}
}
添加回答
举报
