From 62715cce8a07217b1303e82562688525129af29f Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Mon, 12 Oct 2020 21:39:52 +0300 Subject: [PATCH] BasePathAwareController: expect only a single category Signed-off-by: Pekka Helenius --- .../com/fjordtek/bookstore/web/BookBasePathAwareController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java index a036cfc..016c945 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java @@ -88,7 +88,7 @@ public class BookBasePathAwareController { if (categoryName != null) { book.setCategory( - categoryRepository.findByNameIgnoreCaseContaining(categoryName).get(0) + categoryRepository.findByNameIgnoreCaseContaining(categoryName) ); } }