From ec2d9196bd13a8058376fb12011389299997cad5 Mon Sep 17 00:00:00 2001 From: Joep de Jong Date: Mon, 20 May 2024 17:02:54 +0300 Subject: [PATCH] Fix trailing slashes for empty path --- .../sales/controller/sell/SalesSellCustomerController.java | 4 ++-- .../events/sales/controller/sell/SalesSellMainController.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellCustomerController.java b/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellCustomerController.java index b8a99e7e..28773298 100644 --- a/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellCustomerController.java +++ b/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellCustomerController.java @@ -55,7 +55,7 @@ public SalesSellCustomerController( * * @return String */ - @GetMapping("") + @GetMapping({"","/"}) public String identifyCustomer(Model model, RedirectAttributes redirect, @PathVariable String publicReference) { try { Order order = orderService.getByReference(publicReference); @@ -75,7 +75,7 @@ public String identifyCustomer(Model model, RedirectAttributes redirect, @PathVa } } - @PostMapping("") + @PostMapping({"","/"}) public String determineCustomer(RedirectAttributes redirect, @PathVariable String publicReference, @ModelAttribute Customer customer) { Order order; try { diff --git a/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellMainController.java b/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellMainController.java index 8826132c..0126d16e 100644 --- a/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellMainController.java +++ b/src/main/java/ch/wisv/events/sales/controller/sell/SalesSellMainController.java @@ -66,7 +66,7 @@ public SalesSellMainController( * * @return String */ - @GetMapping("") + @GetMapping({"","/"}) public String index(Model model) { Customer currentUser = authenticationService.getCurrentCustomer(); model.addAttribute("products", salesService.getAllGrantedProductByCustomer(currentUser)); @@ -82,7 +82,7 @@ public String index(Model model) { * * @return String */ - @PostMapping("") + @PostMapping({"","/"}) public String createOrder(RedirectAttributes redirect, @ModelAttribute OrderProductDto orderProductDto) { if (orderProductDto.getProducts().isEmpty()) { redirect.addFlashAttribute("error", "Shopping cart can not be empty!");