nest icon indicating copy to clipboard operation
nest copied to clipboard

[Question] Additional decorators used with controller parameters

Open szkumorowski opened this issue 9 years ago • 5 comments

Hello,

Is it possible to set custom properties into additional decorated parameters in controller ? Example:

@Get() async findAll(@Principal() principal:Principal) { }

Where principal will be built with factory based on current request context ?

I tried to use pipes, but without result. Looks interceptors/middlewares are not proper to go with it.

szkumorowski avatar Nov 20 '17 11:11 szkumorowski

@szkumorowski I've created PR https://github.com/nestjs/nest/pull/240, waiting for @kamilmysliwiec approve.

michaelyali avatar Nov 20 '17 13:11 michaelyali

Kudos to @zMotivat0r

gelito avatar Nov 20 '17 23:11 gelito

I need this feature,too. @kamilmysliwiec approve please.

mkzaker avatar Nov 21 '17 06:11 mkzaker

Fantastic job @zMotivat0r. I'm gonna merge this pull request today 🙂

kamilmysliwiec avatar Nov 22 '17 18:11 kamilmysliwiec

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 25 '19 09:09 lock[bot]