From 01d55b761105a476e2eb64e1c3f39ada72b4d0e1 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Fri, 5 Apr 2024 16:02:01 +0400 Subject: [PATCH] lab-2 some minor fixes --- .../main/java/com/ip/library/users/service/UserService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 b75c609..1629e26 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 @@ -32,10 +32,8 @@ public class UserService { } public UserEntity create(UserEntity entity) { - if (entity.getRole() == null || !entity.getRole().equals("user")) { - entity.setRole("user"); - } - entity.setBooks(new ArrayList()); + entity.setRole("user"); + entity.setBooks(new ArrayList<>()); return repository.create(entity); }