Skip to content

Commit

Permalink
refactor: Album 삭제시 하위 Track을 삭제하는 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lcqff committed Jan 27, 2025
1 parent 1315052 commit 88f01c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void updateByUuid(AlbumUpdateRequestDto requestDto, String uuid) {
public void deleteByUuid(String uuid) {
//todo: 내가 업로드한 앨범인지 확인한다.
Album album = getByUuid(uuid);
trackRepository.deleteAllByAlbum(album);
albumRepository.delete(album);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ public interface TrackRepository extends JpaRepository<Track, Long> {
List<Track> findAllByArtist(Artist artist);

Page<Track> findAllByAlbum(Album album, Pageable pageable);
void deleteAllByAlbum(Album album);
}

0 comments on commit 88f01c8

Please sign in to comment.