| | |
| | | @PutMapping("/users") |
| | | @PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")") |
| | | public ResponseEntity<AdminUserDTO> updateUser(@Valid @RequestBody AdminUserDTO userDTO) { |
| | | log.debug("REST request to update User : {}", userDTO); |
| | | // log.debug("REST request to update User : {}", userDTO); |
| | | Optional<User> existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()); |
| | | if (existingUser.isPresent() && (!existingUser.get().getId().equals(userDTO.getId()))) { |
| | | throw new EmailAlreadyUsedException(); |