Skip to content

Commit

Permalink
Updated UserService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
alina tarasova committed Apr 30, 2024
1 parent f379cf4 commit d4fcf44
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/main/java/hexlet/code/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ public UserDTO update(UserUpdateDTO userUpdateDTO, Long id) {

public void delete(Long id) throws Exception {

try {
userRepository.deleteById(id);

} catch (ParentEntityExistsException ex) {

System.out.println("User with id " + id
+ " is associated with the Task entity and cannot be deleted.");
}
userRepository.deleteById(id);
}
}

0 comments on commit d4fcf44

Please sign in to comment.