Skip to content

Commit

Permalink
fix: add missed ClassSerializerInterceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
allohamora committed Dec 18, 2021
1 parent 9c36c21 commit f5ae07f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pkg from '../package.json';
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common';
import { NestFactory, Reflector } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
import { EntityNotFoundExceptionFilter } from './utils/entity-not-found-exception.filter';
Expand All @@ -21,6 +21,7 @@ async function bootstrap() {
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup(SWAGGER_PATH, app, document);

app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
app.useGlobalPipes(new ValidationPipe());
app.useGlobalFilters(new EntityNotFoundExceptionFilter());

Expand Down

0 comments on commit f5ae07f

Please sign in to comment.