Skip to content

Commit

Permalink
fix(T310): fix controllo nome ente partner 20250108
Browse files Browse the repository at this point in the history
  • Loading branch information
federico-tocci-dxc committed Jan 8, 2025
1 parent 1fe1854 commit 194be9b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ public void aggiornaEnte(EnteEntity enteEntity, Long idEnte) {
String errorMessage = String.format("Impossibile aggiornare l'ente con id=%s. Ente non presente", idEnte);
throw new EnteException(errorMessage, CodiceErroreEnum.EN13);
}
if(this.enteRepository.findByNome(enteEntity.getNome()).isPresent()){
if(idEnte != null && this.enteRepository.findByNomeAndIdNot(enteEntity.getNome(), idEnte).isPresent()) {
String errorMessage = String.format("Errore: Ente con stesso nome già esistente", enteEntity.getNome());
throw new EnteException(errorMessage, CodiceErroreEnum.EN25);
}
Expand Down

0 comments on commit 194be9b

Please sign in to comment.