File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 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";
88import { RoutingControllersOptions } from "../RoutingControllersOptions" ;
99import { UseMetadata } from "../metadata/UseMetadata" ;
1010import { getMetadataArgsStorage } from "../index" ;
11+ import { ActionMetadataArgs } from "../metadata/args/ActionMetadataArgs" ;
1112
1213/**
1314 * Builds metadata from the given metadata arguments.
@@ -83,8 +84,21 @@ export class MetadataBuilder {
8384 * Creates action metadatas.
8485 */
8586 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
88102 . map ( actionArgs => {
89103 const action = new ActionMetadata ( controller , actionArgs , this . options ) ;
90104 action . params = this . createParams ( action ) ;
You can’t perform that action at this time.
0 commit comments