Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Combine Multiple Param Decorator

I am trying to combine multiple Parameter Decorator for my application. In my application there are several custom decorators. My Sample Controller.

@Controller('api')
export class MyController {
    @Get('mainresponse')
    public getResponse(
        @Query() query: Partial<IBean>,
        @Headers('user-agent') userAgent: string,
        @MyFirstDocrator() firstDecorator: string,
        @MySecondDocrator() secondDecorator: string,
        @Headers('Referer') referer: string,
        @Cookies('session') sessionId?: string,
    ): Observable<IResponse> {
    ......
    }
}

I am trying to combine these decorators into 1 and return an object with all the decorators value. Something like this

  @Get('mainresponse')
  public getResponse(
    @MyCombinedDecorator() decorator: any
  ): Observable<IResponse> {
 
  ......
  }

But when I am using applyDecorators it is giving me the return value of the last passed decorator.

export const MyCombinedDecorator = () => applyDecorators(Headers('user-agent') as PropertyDecorator, MyFirstDocrator() as PropertyDecorator, Query() as PropertyDecorator);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!