Skip to content

Commit

Permalink
fix(): TypeError when using @apisecurity on controller method
Browse files Browse the repository at this point in the history
Fixes #522
  • Loading branch information
Loban Rahman committed Jan 27, 2020
1 parent bbc13d3 commit 1984800
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/decorators/api-security.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function ApiSecurity(
target: object,
key?: string | symbol,
descriptor?: TypedPropertyDescriptor<any>
) => {
): any => {
if (descriptor) {
metadata = extendMetadata(
metadata,
Expand All @@ -24,7 +24,7 @@ export function ApiSecurity(
metadata,
descriptor.value
);
return descriptor.value;
return descriptor;
}
metadata = extendMetadata(metadata, DECORATORS.API_SECURITY, target);
Reflect.defineMetadata(DECORATORS.API_SECURITY, metadata, target);
Expand Down

0 comments on commit 1984800

Please sign in to comment.