File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { ParamOptions } from "../decorator-options/ParamOptions" ;
1
2
import { getMetadataArgsStorage } from "../index" ;
2
3
3
4
/**
4
5
* Injects all request's route parameters to the controller action parameter.
5
6
* Must be applied on a controller action parameter.
6
7
*/
7
- export function Params ( ) : Function {
8
+ export function Params ( options ?: ParamOptions ) : Function {
8
9
return function ( object : Object , methodName : string , index : number ) {
9
10
getMetadataArgsStorage ( ) . params . push ( {
10
11
type : "params" ,
11
12
object : object ,
12
13
method : methodName ,
13
14
index : index ,
14
- parse : false , // it does not make sense for Param to be parsed
15
- required : false ,
16
- classTransform : undefined
15
+ parse : options ? options . parse : false ,
16
+ required : options ? options . required : undefined ,
17
+ classTransform : options ? options . transform : undefined ,
18
+ explicitType : options ? options . type : undefined ,
19
+ validate : options ? options . validate : undefined ,
17
20
} ) ;
18
21
} ;
19
- }
22
+ }
You can’t perform that action at this time.
0 commit comments