Adding validation pipe to modules
This commit is contained in:
parent
f2de651d50
commit
5368c82ebd
@ -7,7 +7,17 @@ import { AlbumService } from './album.service';
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Album])],
|
||||
controllers: [AlbumController],
|
||||
providers: [AlbumService],
|
||||
providers: [
|
||||
AlbumService,
|
||||
{
|
||||
provide: APP_PIPE,
|
||||
useValue: new ValidationPipe({
|
||||
whitelist: true,
|
||||
forbidNonWhitelisted: true,
|
||||
transform: true,
|
||||
}),
|
||||
},
|
||||
],
|
||||
exports: [TypeOrmModule]
|
||||
})
|
||||
export class AlbumModule {}
|
||||
|
@ -11,7 +11,17 @@ import { SongService } from './song.service';
|
||||
AlbumModule
|
||||
],
|
||||
controllers: [SongController],
|
||||
providers: [SongService],
|
||||
providers: [
|
||||
SongService,
|
||||
{
|
||||
provide: APP_PIPE,
|
||||
useValue: new ValidationPipe({
|
||||
whitelist: true,
|
||||
forbidNonWhitelisted: true,
|
||||
transform: true,
|
||||
}),
|
||||
},
|
||||
],
|
||||
exports: [TypeOrmModule]
|
||||
})
|
||||
export class SongModule {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user