|
@ -217,8 +217,10 @@ public class BookController { |
|
|
Book bookI = bookRepository.findByIsbn(book.getIsbn()); |
|
|
Book bookI = bookRepository.findByIsbn(book.getIsbn()); |
|
|
|
|
|
|
|
|
// If existing ISBN value is not attached to the current book... |
|
|
// If existing ISBN value is not attached to the current book... |
|
|
if (bookI.getId() != book.getId()) { |
|
|
|
|
|
bindingResult.rejectValue("isbn", "error.user", "ISBN code already exists"); |
|
|
|
|
|
|
|
|
if (bookI != null) { |
|
|
|
|
|
if (bookI.getId() != book.getId()) { |
|
|
|
|
|
bindingResult.rejectValue("isbn", "error.user", "ISBN code already exists"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) { |
|
|
if (bindingResult.hasErrors()) { |
|
|