Skip to content

Commit

Permalink
Fix trailing slashes for empty path
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepdeJong committed May 20, 2024
1 parent f7d46ef commit ec2d919
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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!");
Expand Down

0 comments on commit ec2d919

Please sign in to comment.