Skip to content

Commit

Permalink
also check for class metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghel committed Mar 13, 2024
1 parent 0fefdd3 commit 34887cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/http/src/interceptors/fields.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ export class FieldsInterceptor implements NestInterceptor {
return next.handle();
}

const disableFieldsInterceptorMetadata = DecoratorUtils.getMethodDecorator(DisableFieldsInterceptorOptions, context.getHandler());
if (disableFieldsInterceptorMetadata) {
const disableFieldsInterceptorMethodMetadata = DecoratorUtils.getMethodDecorator(DisableFieldsInterceptorOptions, context.getHandler());
if (disableFieldsInterceptorMethodMetadata) {
return next.handle();
}

const disableFieldsInterceptorClassMetadata = DecoratorUtils.getClassDecorator(DisableFieldsInterceptorOptions, context.getClass());
if (disableFieldsInterceptorClassMetadata) {
return next.handle();
}

Expand Down

0 comments on commit 34887cb

Please sign in to comment.