diff --git a/backend/src/album/album.controller.ts b/backend/src/album/album.controller.ts index d340947..2c187d9 100644 --- a/backend/src/album/album.controller.ts +++ b/backend/src/album/album.controller.ts @@ -30,15 +30,13 @@ export class AlbumController { } @Post() - @UsePipes(new ValidationPipe({ transform: true })) - async create( - @Body() createAlbumDto: CreateAlbumDto, - ): Promise { + @UsePipes(new ValidationPipe({ transform: true, whitelist: true })) + async create(@Body() createAlbumDto: CreateAlbumDto): Promise { return this.albumService.create(createAlbumDto); } @Put(':id') - @UsePipes(new ValidationPipe({ transform: true })) + @UsePipes(new ValidationPipe({ transform: true, whitelist: true })) async update( @Param('id') id: number, @Body() updateAlbumDto: UpdateAlbumDto, diff --git a/backend/src/song/song.controller.ts b/backend/src/song/song.controller.ts index 3851996..5ec0952 100644 --- a/backend/src/song/song.controller.ts +++ b/backend/src/song/song.controller.ts @@ -30,15 +30,13 @@ export class SongController { } @Post() - @UsePipes(new ValidationPipe({ transform: true })) - async create( - @Body() createSongDto: CreateSongDto, - ): Promise { + @UsePipes(new ValidationPipe({ transform: true, whitelist: true })) + async create(@Body() createSongDto: CreateSongDto): Promise { return this.songService.create(createSongDto); } @Put(':id') - @UsePipes(new ValidationPipe({ transform: true })) + @UsePipes(new ValidationPipe({ transform: true, whitelist: true })) async update( @Param('id') id: number, @Body() updateSongDto: UpdateSongDto, diff --git a/frontend/src/app/actions.tsx b/frontend/src/app/actions.tsx index 5c38806..2d75d17 100644 --- a/frontend/src/app/actions.tsx +++ b/frontend/src/app/actions.tsx @@ -58,7 +58,6 @@ export async function createAlbum(formData: FormData) { const title = formData.get('title'); const artist = formData.get('artist'); const genre = formData.get('genre'); - console.log(title, artist, genre); return fetch("https://api.anatid.net/album/", { method: "POST", headers: { "Content-Type": "application/json" },