From e87451660a303054daa066f15ab1e8449a3424b9 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Sat, 21 Oct 2023 08:42:39 +0100 Subject: [PATCH] Use hx-push-url one more time --- .../samples/petclinic/owner/OwnerController.java | 5 +++-- src/main/resources/templates/fragments/owners.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java index 63850cf..cd43911 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -118,7 +118,8 @@ public String htmxInitFindForm() { } @GetMapping("/owners") - public String ownersList(@RequestParam(defaultValue = "1") int page, Owner owner, BindingResult result, Model model) { + public String ownersList(@RequestParam(defaultValue = "1") int page, Owner owner, BindingResult result, + Model model) { return processFindForm(page, owner, result, model, "owners/findOwners", "owners/ownersList"); } @@ -128,7 +129,7 @@ public HtmxResponse htmxOwnersList(@RequestParam(defaultValue = "1") int page, O Model model) { String view = processFindForm(page, owner, result, model, FRAGMENTS_OWNERS_FIND_FORM, "fragments/owners :: list"); - return new HtmxResponse().addTemplate(view).pushHistory("/owners/find?lastName=" + owner.getLastName()); + return new HtmxResponse().addTemplate(view); } public String processFindForm(@RequestParam(defaultValue = "1") int page, Owner owner, BindingResult result, diff --git a/src/main/resources/templates/fragments/owners.html b/src/main/resources/templates/fragments/owners.html index 4e59731..834feb4 100644 --- a/src/main/resources/templates/fragments/owners.html +++ b/src/main/resources/templates/fragments/owners.html @@ -1,7 +1,7 @@

Find Owners

-