Skip to content

Instantly share code, notes, and snippets.

@ezirmusitua
Created December 31, 2018 02:45
Show Gist options
  • Save ezirmusitua/1e535e531d9a278e38819e91a616d5cc to your computer and use it in GitHub Desktop.
Save ezirmusitua/1e535e531d9a278e38819e91a616d5cc to your computer and use it in GitHub Desktop.
[Parse integer query params] parse integer query parameters in nestjs #node #nestjs
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