Created
December 31, 2018 02:45
-
-
Save ezirmusitua/1e535e531d9a278e38819e91a616d5cc to your computer and use it in GitHub Desktop.
[Parse integer query params] parse integer query parameters in nestjs #node #nestjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Controller, | |
Get, | |
ParseIntPipe, | |
Query, | |
} from '@nestjs/common'; | |
export class GalleryController { | |
constructor() { | |
} | |
@Get('') | |
thumbnail(@Query('id', ParseIntPipe) id: number) { | |
console.log('int query parameter id: ', id) | |
return {id} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment