Browse Source

Simplify code of retrieving current year in add form; fix typo

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.1-alpha
Pekka Helenius 4 years ago
parent
commit
128ee7ef04
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java

+ 2
- 5
bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java View File

@ -96,13 +96,10 @@ public class BookController {
) {
Book newBook = new Book();
dataModel.addAttribute("book", new Book());
newBook.setYear(Year.now().getValue());
dataModel.addAttribute("book", newBook);
dataModel.addAttribute("categories", categoryRepository.findAll());
if (newBook.getYear() == 0) {
newBook.setYear(Year.now().getValue());
}
httpServerLogger.logMessageNormal(
requestData,
bookAddPageView + ": " + "HTTPOK"


Loading…
Cancel
Save