NestJS · Junior · Question 22 of 75
How do you read ?page=2 in a controller?
- 1
@Param('page') - ✓Correct answer:
@Query('page') page: string - 3
@Body('page')
Explanation
Query values are strings. Convert them with a pipe (ParseIntPipe, DefaultValuePipe) or with ValidationPipe and transform: true.