This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git

commit 8c395624c7eae5429999bdfa7e1d112ba3114bb1
Author: Dan Haywood <[email protected]>
AuthorDate: Sun May 26 12:52:14 2024 +0100

    adds 'removePet' action
---
 .../java/domainapp/modules/petowner/dom/petowner/PetOwner.java     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
 
b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
index 0547b0d..d0a4fe4 100644
--- 
a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
+++ 
b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
@@ -171,6 +171,13 @@ public class PetOwner implements Comparable<PetOwner>, 
CalendarEventable {
         return this;
     }
 
+    @Action(choicesFrom = "pets")
+    @ActionLayout(associateWith = "pets", sequence = "2")
+    public PetOwner removePet(@PetName final Pet pet) {
+        pets.remove(pet);
+        return this;
+    }
+
 
     @AttributeOverrides({
             @AttributeOverride(name="name",    
column=@Column(name="attachment_name")),

Reply via email to