Skip to content

Commit

Permalink
Merge pull request #591 from eugenio165/bugfix/double-decorators
Browse files Browse the repository at this point in the history
fix(crud): Custom route decorators applied twice
  • Loading branch information
michaelyali committed Aug 18, 2020
2 parents 644acfd + d905b66 commit 77bb83a
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions packages/crud/src/crud/reflection.helper.ts
Expand Up @@ -84,25 +84,16 @@ export class R {
target: object,
name: string,
) {
// this makes proxy decorator works
Reflect.defineProperty(
target,
name,
Reflect.decorate(
decorators,
target,
name,
Reflect.getOwnPropertyDescriptor(target, name),
),
);

// this makes metadata decorator works
Reflect.decorate(
const decoratedDescriptor = Reflect.decorate(
decorators,
target,
name,
Reflect.getOwnPropertyDescriptor(target, name),
);

// this makes proxy decorator works
Reflect.defineProperty(target, name, decoratedDescriptor);
}

static setParsedRequestArg(index: number) {
Expand Down

0 comments on commit 77bb83a

Please sign in to comment.