Skip to content

Commit

Permalink
<update>: revert the logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
wickdynex committed Nov 5, 2024
1 parent a6aa51b commit 2873e55
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owne
// checking if the pet name already exist for the owner
if (StringUtils.hasText(petName)) {
Pet existingPet = owner.getPet(petName.toLowerCase(), false);
if (existingPet != null && existingPet.getId().equals(pet.getId())) {
if (existingPet != null && !existingPet.getId().equals(pet.getId())) {
result.rejectValue("name", "duplicate", "already exists");
}
}
Expand Down

0 comments on commit 2873e55

Please sign in to comment.