From 17f0c645f1f48af13fc42353d7383321a91a55c2 Mon Sep 17 00:00:00 2001 From: CodeSteak Date: Thu, 25 Jun 2020 11:52:27 +0200 Subject: [PATCH] Show all articles if no term is provided. fixes #127 --- .../hso/ecommerce/controller/shop/ShopSearchController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java b/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java index 53d03fb..895900d 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java @@ -42,9 +42,8 @@ public class ShopSearchController { List
articles = articleRepository.getArticlesByCategory(category); //search by Category model.addAttribute("articles", articles); } else { - request.setAttribute("error", "Es wurden keine Suchparameter angegeben."); - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - return "error/404"; + List
articles = SearchByTermAction.searchByTerm("", articleRepository); + model.addAttribute("articles", articles); } // Show term in search box