【发布时间】:2021-02-16 19:15:40
【问题描述】:
我是 javascript 世界的新手。 httpService.post 永远不会执行。我怎样才能做到这一点?
async createInboundRequest_1(payload: InboundRequestDto) {
console.log("Request Dto ");
console.log(payload);
return this.fetchLookupReferenceData(payload).then(res => {
console.log("Final Response ");
console.log(res);
this.httpService.post(this.api_url, res).pipe(
map(res_1 => res_1.data),
)
});
}
【问题讨论】:
-
“最终响应”是否已注销?
-
如果你从不在
await里面createInboundRequest_1为什么要async createInboundRequest_1?另外,return this.fetchLookupReferenceData(payload).then...您确实意识到您将始终返回解析为undefined的 Promise,因为您不会在.then中返回任何内容?
标签: javascript node.js typescript promise observable