Adding logger on api
All checks were successful
Music Collection CI Workflow / test (./frontend) (push) Successful in 36s
Music Collection CI Workflow / test (./backend) (push) Successful in 31s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 51s
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 25s
All checks were successful
Music Collection CI Workflow / test (./frontend) (push) Successful in 36s
Music Collection CI Workflow / test (./backend) (push) Successful in 31s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 51s
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 25s
This commit is contained in:
parent
0b3076de3c
commit
606d8f3e49
@ -43,17 +43,23 @@ export class AlbumService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update(id: number, updateAlbumDto: UpdateAlbumDto): Promise<Album | null> {
|
async update(id: number, updateAlbumDto: UpdateAlbumDto): Promise<Album | null> {
|
||||||
|
console.log(id, updateAlbumDto);
|
||||||
if (id === updateAlbumDto.id) {
|
if (id === updateAlbumDto.id) {
|
||||||
const albumToUpdate = await this.albumRepository.findOneBy({ id: updateAlbumDto.id });
|
const albumToUpdate = await this.albumRepository.findOneBy({ id: updateAlbumDto.id });
|
||||||
if (!albumToUpdate)
|
if (!albumToUpdate) {
|
||||||
|
console.log("Didn't find album: ", id);
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
albumToUpdate.title = updateAlbumDto.title;
|
albumToUpdate.title = updateAlbumDto.title;
|
||||||
albumToUpdate.artist = updateAlbumDto.artist;
|
albumToUpdate.artist = updateAlbumDto.artist;
|
||||||
albumToUpdate.genre = updateAlbumDto.genre;
|
albumToUpdate.genre = updateAlbumDto.genre;
|
||||||
|
console.log("Saving album:", albumToUpdate);
|
||||||
const savedAlbum = await this.albumRepository.save(albumToUpdate);
|
const savedAlbum = await this.albumRepository.save(albumToUpdate);
|
||||||
|
console.log("Saved album: ", savedAlbum);
|
||||||
return savedAlbum;
|
return savedAlbum;
|
||||||
} else {
|
} else {
|
||||||
|
console.log("ids don't match", id, updateAlbumDto);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user