Skip to content

Commit

Permalink
fix: Updated Contact.role
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Oct 5, 2024
1 parent 97693b6 commit a23026c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/chat/yourway/model/Contact.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/chat/yourway/service/ContactService.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,15 @@ public Contact create(ContactRequestDto contactRequestDto) {
);
}

Contact contact = (Contact.builder()
Contact contact = Contact.builder()
.nickname(contactRequestDto.getNickname())
.avatarId(contactRequestDto.getAvatarId())
.email(contactRequestDto.getEmail())
.password(myPasswordEncoder.encode(contactRequestDto.getPassword()))
.isActive(false)
.role(USER)
.isPermittedSendingPrivateMessage(true)
.build()
);
.build();

contactRepository.save(contact);

Expand Down

0 comments on commit a23026c

Please sign in to comment.