删除了service中delete throw exception的message
This commit is contained in:
parent
fdb9dc6daf
commit
173b507361
@ -50,7 +50,7 @@ public class NewsService {
|
||||
|
||||
public void deleteNews(Long id) {
|
||||
if (!newsRepository.existsById(id)) {
|
||||
throw new EntityNotFoundException("News with id " + id + " not found.");
|
||||
throw new EntityNotFoundException();
|
||||
}
|
||||
newsRepository.deleteById(id);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user