Skip to content

Commit

Permalink
[fix] 회원탈퇴시 동의 항목 철회하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
isanghaessi committed Sep 11, 2023
1 parent d686b66 commit c1b5cc1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.beside.startrail.relationship.repository.RelationshipRepository;
import com.beside.startrail.relationship.service.RelationshipService;
import com.beside.startrail.user.document.User;
import com.beside.startrail.user.model.AllowInformation;
import com.beside.startrail.user.repository.UserRepository;
import com.beside.startrail.user.service.UserService;
import java.util.Optional;
Expand Down Expand Up @@ -67,6 +68,9 @@ protected Mono<ServerResponse> signedTransactionalHandle(ServerRequest serverReq
.map(user ->
User.fromUseYn(user, YnType.N)
)
.map(user ->
User.fromAllowInformation(user, AllowInformation.builder().build())
)
.map(UserService::create)
.flatMap(userSaveCommand ->
userSaveCommand.execute(userRepository)
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/beside/startrail/user/document/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ public static User fromUseYn(User user, YnType useYn) {
.build();
}

public static User fromAllowInformation(User user, AllowInformation allowInformation) {
return User.builder()
.userId(user.userId)
.sequence(user.sequence)
.userInformation(user.userInformation)
.allowInformation(allowInformation)
.useYn(user.useYn)
.withdrawlReason(user.getWithdrawlReason())
.build();
}

public static User fromReason(User user, String reason) {
return User.builder()
.userId(user.getUserId())
Expand Down

0 comments on commit c1b5cc1

Please sign in to comment.