Skip to content
Snippets Groups Projects
Commit 8800608f authored by 김준하's avatar 김준하
Browse files

Add delete Favorite

parent 40504e43
No related branches found
No related tags found
1 merge request!6Add delete Favorite
......@@ -40,4 +40,9 @@ public class MyWebController {
return service.saveFavorite(favorite);
}
@DeleteMapping(value="/likes/{id}")
public void deleteById(@PathVariable String id){
service.deleteFavorite(id);
}
}
......@@ -7,4 +7,6 @@ import java.util.List;
public interface FavoriteRepository extends JpaRepository<FavoriteMusic, String> {
List<FavoriteMusic> findAll();
void deleteByCollectionId(String id);
}
......@@ -54,4 +54,13 @@ public class MusicService {
return 0;
}
}
public void deleteFavorite(String id){
try{
albumsRepo.deleteByCollectionId(id);
}
catch(Exception e){
System.out.println(e.toString());
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment