mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:35:50 +00:00
pet name check added
This commit is contained in:
parent
1b772ef97f
commit
50c64de461
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ class PetController {
|
||||||
|
|
||||||
String petName = pet.getName();
|
String petName = pet.getName();
|
||||||
|
|
||||||
// checking if the pet name already exist for the owner
|
//checking pet name
|
||||||
if (StringUtils.hasText(petName)) {
|
if (StringUtils.hasText(petName)) {
|
||||||
Pet existingPet = owner.getPet(petName.toLowerCase(), false);
|
Pet existingPet = owner.getPet(petName.toLowerCase(), false);
|
||||||
if (existingPet != null && existingPet.getId() != pet.getId()) {
|
if (existingPet != null && existingPet.getId() != pet.getId()) {
|
||||||
|
|
Loading…
Reference in a new issue