There's the bug! Was doing an equal and type comparison
This commit is contained in:
parent
1566da28ad
commit
900b9c38b7
@ -44,7 +44,7 @@ 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);
|
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);
|
console.log("Didn't find album: ", id);
|
||||||
|
@ -43,7 +43,7 @@ export class SongService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update(id: number, updateSongDto: UpdateSongDto): Promise<Song | null> {
|
async update(id: number, updateSongDto: UpdateSongDto): Promise<Song | null> {
|
||||||
if (id === updateSongDto.id) {
|
if (id == updateSongDto.id) {
|
||||||
const album = await this.albumRepository.findOneBy({id: updateSongDto.albumId});
|
const album = await this.albumRepository.findOneBy({id: updateSongDto.albumId});
|
||||||
const songToUpdate = await this.songRepository.findOneBy({ id: updateSongDto.id });
|
const songToUpdate = await this.songRepository.findOneBy({ id: updateSongDto.id });
|
||||||
if (!songToUpdate || !album)
|
if (!songToUpdate || !album)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user