Custom instances
Add custom instances of ParseIntPipe for every controller, this ensures that the validation of datatypes is sending the right messages.
Example:
@Put(':id')
update(@Param('id', new ParseIntPipe({
exceptionFactory: () => {
return new BadRequestException('El id no es un número');
}
})) id: number, @Body() updateDto: UpdateDto) {
return this.exampleService.update(id, updateDto);
}
Custom instances Add custom instances of ParseIntPipe for every controller, this ensures that the validation of datatypes is sending the right messages. Example: