mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
new feature
This commit is contained in:
parent
1b923650e2
commit
87ae9b761b
1 changed files with 1 additions and 1 deletions
|
@ -134,6 +134,7 @@ class PetController {
|
|||
public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
|
||||
//new features...
|
||||
String petName = pet.getName();
|
||||
|
||||
// checking if the pet name already exist for the owner
|
||||
|
@ -143,7 +144,6 @@ class PetController {
|
|||
result.rejectValue("name", "duplicate", "already exists");
|
||||
}
|
||||
}
|
||||
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
if (pet.getBirthDate() != null && pet.getBirthDate().isAfter(currentDate)) {
|
||||
result.rejectValue("birthDate", "typeMismatch.birthDate");
|
||||
|
|
Loading…
Reference in a new issue