【发布时间】:2020-05-06 19:33:23
【问题描述】:
我对 JS 很陌生,我正在使用 NestJS 和 mongo 来开发后端 api。我有一个基本的 CRUD 操作。我希望能够创建文档,将其返回给用户并运行另一个方法而不影响用户。
@Post()
async create(@Body() body: Dto, @Headers('id') id: string) {
body.id = id;
const item = await this.service.create(body);
return item;
// Now, I want to call another method async to trace history changes
}
【问题讨论】:
标签: node.js asynchronous async-await controller nestjs