mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-04-25 11:52:49 +00:00
Resolved merge conflicts
This commit is contained in:
commit
cb85d87ee3
1 changed files with 18 additions and 1 deletions
|
@ -43,7 +43,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/owners/{ownerId}")
|
@RequestMapping("/owners/{ownerId}")
|
||||||
class PetController {
|
class privatePetController {
|
||||||
|
|
||||||
private static final String VIEWS_PETS_CREATE_OR_UPDATE_FORM = "pets/createOrUpdatePetForm";
|
private static final String VIEWS_PETS_CREATE_OR_UPDATE_FORM = "pets/createOrUpdatePetForm";
|
||||||
|
|
||||||
|
@ -147,9 +147,26 @@ class PetController {
|
||||||
return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
|
return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
owner.addPet(pet);
|
owner.addPet(pet);
|
||||||
owner.updatePet(pet);
|
owner.updatePet(pet);
|
||||||
|
|
||||||
|
||||||| 6148ddd
|
||||||
|
owner.addPet(pet);
|
||||||
|
=======
|
||||||
|
//owner.addPet(pet);
|
||||||
|
|
||||||
|
List<Pet> petlist = owner.getPets();
|
||||||
|
for(int i=0 ; i<petlist.size() ; i++)
|
||||||
|
{
|
||||||
|
if(petlist.get(i).getId().equals(pet.getId()))
|
||||||
|
{
|
||||||
|
petlist.set(i,pet);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> 588fd808f860ff0896eb2e4cb841f8cacd19855b
|
||||||
this.owners.save(owner);
|
this.owners.save(owner);
|
||||||
redirectAttributes.addFlashAttribute("message", "Pet details has been edited");
|
redirectAttributes.addFlashAttribute("message", "Pet details has been edited");
|
||||||
return "redirect:/owners/{ownerId}";
|
return "redirect:/owners/{ownerId}";
|
||||||
|
|
Loading…
Reference in a new issue