From a23026c36b7293e909d6556c89d7e8d1d26464ea Mon Sep 17 00:00:00 2001 From: Vladik-gif Date: Sat, 5 Oct 2024 15:55:29 +0300 Subject: [PATCH] fix: Updated Contact.role --- src/main/java/com/chat/yourway/model/Contact.java | 1 - src/main/java/com/chat/yourway/service/ContactService.java | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/chat/yourway/model/Contact.java b/src/main/java/com/chat/yourway/model/Contact.java index a1b745d..cac2847 100644 --- a/src/main/java/com/chat/yourway/model/Contact.java +++ b/src/main/java/com/chat/yourway/model/Contact.java @@ -38,7 +38,6 @@ public class Contact implements UserDetails { private boolean isActive; @Enumerated(EnumType.STRING) - @Column(nullable = false, length = 50) private Role role; private boolean isPermittedSendingPrivateMessage; diff --git a/src/main/java/com/chat/yourway/service/ContactService.java b/src/main/java/com/chat/yourway/service/ContactService.java index c68871d..db4d509 100644 --- a/src/main/java/com/chat/yourway/service/ContactService.java +++ b/src/main/java/com/chat/yourway/service/ContactService.java @@ -44,7 +44,7 @@ public Contact create(ContactRequestDto contactRequestDto) { ); } - Contact contact = (Contact.builder() + Contact contact = Contact.builder() .nickname(contactRequestDto.getNickname()) .avatarId(contactRequestDto.getAvatarId()) .email(contactRequestDto.getEmail()) @@ -52,8 +52,7 @@ public Contact create(ContactRequestDto contactRequestDto) { .isActive(false) .role(USER) .isPermittedSendingPrivateMessage(true) - .build() - ); + .build(); contactRepository.save(contact);