nestjs query params

Solutions on MaxInterview for nestjs query params by the best coders in the world

showing results for - "nestjs query params"
Deja
24 Jun 2018
1import { Controller, Get, Query } from '@nestjs/common';
2
3@Controller('api/report')
4export class ReportController {
5  @Get('earnings')
6  async earning(@Query() query: any) {
7        return query;
8  }
9}
10/**
11Postman url: http://localhost:3008/api/report/earnings?opt=2&clt=&vhl=&mto=&from=26/07/2018&end=13/09/2021
12**/
13
14//Result
15
16const resonseRequest = {
17    "opt": "2",
18    "clt": "",
19    "vhl": "",
20    "mto": "",
21    "from": "26/07/2018",
22    "end": "13/09/2021"
23}