Delete
Atualizado
Atualizado
Controller
@DeleteMapping(value = "/{id}")
public ResponseEntity<UserDTO> delete(@PathVariable String id) {
userService.delete(id);
return ResponseEntity.noContent().build();
}
Service
public void delete(String id) {
getEntityById(id);
userRepository.deleteById(id);
}