diff --git a/SpringApp/library/src/main/java/com/ip/library/controllers/users/UserBookController.java b/SpringApp/library/src/main/java/com/ip/library/controllers/users/UserBookController.java index 0a6291e..1b9b300 100644 --- a/SpringApp/library/src/main/java/com/ip/library/controllers/users/UserBookController.java +++ b/SpringApp/library/src/main/java/com/ip/library/controllers/users/UserBookController.java @@ -26,6 +26,8 @@ public class UserBookController { private static final String BOOK_SEARCH_VIEW = "book-search"; private static final String USER_FAVORITES_VIEW = "user-favorites"; private static final String PAGE_ATTRIBUTE = "page"; + private static final String AUTHOR_ATTRIBUTE = "authorId"; + private static final String TYPE_ATTRIBUTE = "typeId"; private final UserService userService; private final BookService bookService; @@ -84,8 +86,8 @@ public class UserBookController { @GetMapping(Constants.API_URL + "/search") public String getAll( @RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page, - @RequestParam(name = "typeId", defaultValue = "-1") Long typeId, - @RequestParam(name = "authorId", defaultValue = "-1") Long authorId, + @RequestParam(name = TYPE_ATTRIBUTE, defaultValue = "-1") Long typeId, + @RequestParam(name = AUTHOR_ATTRIBUTE, defaultValue = "-1") Long authorId, Model model) { final Map attributes = PageAttributesMapper.toAttributes( bookService.getAll(typeId, authorId, page, Constants.DEFUALT_PAGE_SIZE),