diff --git a/SpringApp/library/src/main/java/com/ip/library/books/service/BookService.java b/SpringApp/library/src/main/java/com/ip/library/books/service/BookService.java index 629fc37..6828d25 100644 --- a/SpringApp/library/src/main/java/com/ip/library/books/service/BookService.java +++ b/SpringApp/library/src/main/java/com/ip/library/books/service/BookService.java @@ -48,6 +48,7 @@ public class BookService { public BookEntity update(Long id, BookEntity entity) { final BookEntity existsEntity = get(id); + existsEntity.setName(entity.getName()); existsEntity.setType(entity.getType()); existsEntity.setAuthor(entity.getAuthor()); return repository.update(existsEntity); diff --git a/SpringApp/library/src/main/java/com/ip/library/users/service/UserService.java b/SpringApp/library/src/main/java/com/ip/library/users/service/UserService.java index 8fc727f..fa61848 100644 --- a/SpringApp/library/src/main/java/com/ip/library/users/service/UserService.java +++ b/SpringApp/library/src/main/java/com/ip/library/users/service/UserService.java @@ -27,12 +27,16 @@ public class UserService { } public UserEntity create(UserEntity entity) { + if (entity.getRole().equals("admin")) { + entity.setRole("user"); + } return repository.create(entity); } public UserEntity update(Long id, UserEntity entity) { final UserEntity existsEntity = get(id); existsEntity.setName(entity.getName()); + existsEntity.setPassword(entity.getPassword()); return repository.update(existsEntity); }