Skip to content

Commit

Permalink
fix(crud): Applying route decorators only once
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenio165 committed Aug 8, 2020
1 parent 644acfd commit d905b66
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 d905b66

Please sign in to comment.