Skip to content

Commit

Permalink
Resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
smnk107 committed Dec 22, 2024
2 parents 1587384 + 588fd80 commit cb85d87
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
@Controller
@RequestMapping("/owners/{ownerId}")
class PetController {
class privatePetController {

private static final String VIEWS_PETS_CREATE_OR_UPDATE_FORM = "pets/createOrUpdatePetForm";

Expand Down Expand Up @@ -147,9 +147,26 @@ public String processUpdateForm(Owner owner, @Valid Pet pet, BindingResult resul
return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
}

<<<<<<< HEAD
owner.addPet(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);
redirectAttributes.addFlashAttribute("message", "Pet details has been edited");
return "redirect:/owners/{ownerId}";
Expand Down

0 comments on commit cb85d87

Please sign in to comment.