I have a POST request entry where I specify an "account" parameter as a path parameter, and a boolean in the body to set validation state, like:
POST /users/authorized/USER_ACCOUNT1
The body would carry:
valid=1
I have the following controller entry:
@ApiTags('users')
@ApiOperation( { summary: 'Set user account status. '} )
@Post('authorized/:account')
async setAuthStatus(params: SetUserAuthDto) {
return this.userService.setUserAuthDto(params);
}
How I can feed both the "account" and the request body "status" parameter to the same DTO? I assume I cannot use both decorators @Param and @Body there. Should I use pipes?
I'm new in NestJS so excuse my ignorance.
Thanks.