File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import {ResponseHandlerMetadata} from "../metadata/ResponseHandleMetadata";
8
8
import { RoutingControllersOptions } from "../RoutingControllersOptions" ;
9
9
import { UseMetadata } from "../metadata/UseMetadata" ;
10
10
import { getMetadataArgsStorage } from "../index" ;
11
+ import { ActionMetadataArgs } from "../metadata/args/ActionMetadataArgs" ;
11
12
12
13
/**
13
14
* Builds metadata from the given metadata arguments.
@@ -83,8 +84,21 @@ export class MetadataBuilder {
83
84
* Creates action metadatas.
84
85
*/
85
86
protected createActions ( controller : ControllerMetadata ) : ActionMetadata [ ] {
86
- return getMetadataArgsStorage ( )
87
- . filterActionsWithTarget ( controller . target )
87
+ let target = controller . target ;
88
+ let actionsWithTarget : ActionMetadataArgs [ ] = [ ] ;
89
+ while ( target ) {
90
+ actionsWithTarget . push (
91
+ ...getMetadataArgsStorage ( )
92
+ . filterActionsWithTarget ( target )
93
+ . filter ( action => {
94
+ return actionsWithTarget
95
+ . map ( a => a . method )
96
+ . indexOf ( action . method ) === - 1 ;
97
+ } )
98
+ ) ;
99
+ target = Object . getPrototypeOf ( target ) ;
100
+ }
101
+ return actionsWithTarget
88
102
. map ( actionArgs => {
89
103
const action = new ActionMetadata ( controller , actionArgs , this . options ) ;
90
104
action . params = this . createParams ( action ) ;
You can’t perform that action at this time.
0 commit comments