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