Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
회원가입 로직 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Feb 18, 2024
1 parent 23a278b commit 3ef3473
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public Mono<Void> execute(SignupRequest request) {

return Mono.fromCallable(() -> passwordEncoder.encode(request.password()))
.subscribeOn(scheduler)
.map(password -> User.builder()
.flatMap(password -> {
User user = User.builder()
.name(request.name())
.email(request.email())
.password(password)
Expand All @@ -60,13 +61,15 @@ public Mono<Void> execute(SignupRequest request) {
.gen(request.gen())
.major(getMajorType.execute(request.major()))
.build())
.build())
.flatMap(userRepository::save)
.flatMap(user -> createDocumentByUser.execute(user)
.flatMap(document -> {
user.setDocumentId(document.getId());
return userRepository.save(user);
}));
.build();

return userRepository.save(user)
.flatMap(savedUser -> createDocumentByUser.execute(savedUser)
.flatMap(document -> {
savedUser.setDocumentId(document.getId());
return userRepository.save(savedUser);
}));
});
}))).then();
}

Expand Down

0 comments on commit 3ef3473

Please sign in to comment.