Skip to content
Snippets Groups Projects
Commit fe68d7df authored by kim daeun's avatar kim daeun
Browse files

Add delete Favorite_Exception

parent a3ec9665
Branches
No related tags found
No related merge requests found
...@@ -55,12 +55,18 @@ public class MusicService { ...@@ -55,12 +55,18 @@ public class MusicService {
// 존재하는지 확인 (없으면 예외 혹은 0 return 등) // 존재하는지 확인 (없으면 예외 혹은 0 return 등)
public int deleteFavorite(String id) { public int deleteFavorite(String id) {
try {
if (albumsRepo.existsById(id)) { if (albumsRepo.existsById(id)) {
albumsRepo.deleteById(id); albumsRepo.deleteById(id);
return 1; return 1;
} else { } else {
return 0; return 0;
} }
} catch (Exception e) {
System.out.println(e.toString());
return 0;
}
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment