Skip to content

Commit

Permalink
Merge pull request #204 from TripInfoWeb/fix/user-login
Browse files Browse the repository at this point in the history
Refactor : 성별입력시 유저 프로필 변경
  • Loading branch information
hyeonjaez authored Sep 22, 2024
2 parents 03129f2 + 4046560 commit 3f8e1f3
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,19 @@ public Page<GatheringApplicantResponse> retrieveGatheringApplicant(Pageable page
@Transactional
public void updateUserInfo(Long userId, UpdateUserInfoRequest request) {
User user = userRepository.findByUserId(userId);
changeUserProfile(user, request);
user.updateUserInfo(request);
}

private void changeUserProfile(User user, UpdateUserInfoRequest request) {
String sex = request.getSex();
if(sex.equals("male")){
user.updateUserImage(maleProfileUrl);
} else if (sex.equals("female")) {
user.updateUserImage(femaleProfileUrl);
}
}

private void resetUserProfile(User user, String imageUrl, String sex) {
checkUserProfile(imageUrl);
if (sex.equals("male")) {
Expand Down

0 comments on commit 3f8e1f3

Please sign in to comment.