-
-
Save dan-dm/48defb03baf2cc3da4bda3fbcc2f3c27 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