RLH-21 - Fix Sonar
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9b3f43937f
commit
17ba5b8b9d
@ -35,12 +35,10 @@ public class UserServiceImpl implements UserService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteUser(UUID id) {
|
public boolean deleteUser(UUID id) {
|
||||||
if (userRepository.findById(id).isEmpty()) {
|
userRepository.delete(userRepository
|
||||||
throw new UsernameNotFoundException("User not found");
|
.findById(id)
|
||||||
}
|
.orElseThrow(() -> new UsernameNotFoundException("User not found")));
|
||||||
if (userRepository.findById(id).isPresent()) {
|
|
||||||
userRepository.delete(userRepository.findById(id).get());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user