Skip to content

Commit ee3188e

Browse files
authored
Merge pull request #53 from klerick/copy_metadata_from_parent_to_warepr
fix(json-api-nestjs): copy metadata from target method to wrapper
2 parents 24f93a7 + 4902a6e commit ee3188e

File tree

1 file changed

+7
-0
lines changed
  • libs/json-api-nestjs/src/lib/helper/bind-controller

1 file changed

+7
-0
lines changed

libs/json-api-nestjs/src/lib/helper/bind-controller/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ export function bindController(
4545
// @ts-ignore
4646
return implementationResultFunction.call(this, ...args);
4747
};
48+
Reflect.getMetadataKeys(implementationResultFunction).forEach((metadataKey) => {
49+
Reflect.defineMetadata(
50+
metadataKey,
51+
Reflect.getMetadata(metadataKey, implementationResultFunction),
52+
controller.prototype[name]
53+
);
54+
});
4855

4956
const descriptor = Object.getOwnPropertyDescriptor(
5057
controller.prototype,

0 commit comments

Comments
 (0)