Answers for "nestjs query params"

0

nestjs query params

import { Controller, Get, Query } from '@nestjs/common';

@Controller('api/report')
export class ReportController {
  @Get('earnings')
  async earning(@Query() query: any) {
        return query;
  }
}
/**
Postman url: http://localhost:3008/api/report/earnings?opt=2&clt=&vhl=&mto=&from=26/07/2018&end=13/09/2021
**/

//Result

const resonseRequest = {
    "opt": "2",
    "clt": "",
    "vhl": "",
    "mto": "",
    "from": "26/07/2018",
    "end": "13/09/2021"
}
Posted by: Guest on September-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language