Adding Whitelist to posts and puts
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 35s
Music Collection CI Workflow / test (./frontend) (push) Successful in 38s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 54s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m52s
Music Collection CI Workflow / deploy (push) Successful in 24s
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 35s
Music Collection CI Workflow / test (./frontend) (push) Successful in 38s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 54s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m52s
Music Collection CI Workflow / deploy (push) Successful in 24s
This commit is contained in:
parent
b426187753
commit
6222d2f8e2
@ -30,15 +30,13 @@ export class AlbumController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
@UsePipes(new ValidationPipe({ transform: true }))
|
@UsePipes(new ValidationPipe({ transform: true, whitelist: true }))
|
||||||
async create(
|
async create(@Body() createAlbumDto: CreateAlbumDto): Promise<Album | string | null> {
|
||||||
@Body() createAlbumDto: CreateAlbumDto,
|
|
||||||
): Promise<Album | string | null> {
|
|
||||||
return this.albumService.create(createAlbumDto);
|
return this.albumService.create(createAlbumDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put(':id')
|
@Put(':id')
|
||||||
@UsePipes(new ValidationPipe({ transform: true }))
|
@UsePipes(new ValidationPipe({ transform: true, whitelist: true }))
|
||||||
async update(
|
async update(
|
||||||
@Param('id') id: number,
|
@Param('id') id: number,
|
||||||
@Body() updateAlbumDto: UpdateAlbumDto,
|
@Body() updateAlbumDto: UpdateAlbumDto,
|
||||||
|
@ -30,15 +30,13 @@ export class SongController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
@UsePipes(new ValidationPipe({ transform: true }))
|
@UsePipes(new ValidationPipe({ transform: true, whitelist: true }))
|
||||||
async create(
|
async create(@Body() createSongDto: CreateSongDto): Promise<Song | string | null> {
|
||||||
@Body() createSongDto: CreateSongDto,
|
|
||||||
): Promise<Song | string | null> {
|
|
||||||
return this.songService.create(createSongDto);
|
return this.songService.create(createSongDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put(':id')
|
@Put(':id')
|
||||||
@UsePipes(new ValidationPipe({ transform: true }))
|
@UsePipes(new ValidationPipe({ transform: true, whitelist: true }))
|
||||||
async update(
|
async update(
|
||||||
@Param('id') id: number,
|
@Param('id') id: number,
|
||||||
@Body() updateSongDto: UpdateSongDto,
|
@Body() updateSongDto: UpdateSongDto,
|
||||||
|
@ -58,7 +58,6 @@ export async function createAlbum(formData: FormData) {
|
|||||||
const title = formData.get('title');
|
const title = formData.get('title');
|
||||||
const artist = formData.get('artist');
|
const artist = formData.get('artist');
|
||||||
const genre = formData.get('genre');
|
const genre = formData.get('genre');
|
||||||
console.log(title, artist, genre);
|
|
||||||
return fetch("https://api.anatid.net/album/", {
|
return fetch("https://api.anatid.net/album/", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user