diff --git a/src/main/java/com/wooribound/domain/wbuser/WbUserServiceImpl.java b/src/main/java/com/wooribound/domain/wbuser/WbUserServiceImpl.java index 6bd15c8..bcdbc79 100644 --- a/src/main/java/com/wooribound/domain/wbuser/WbUserServiceImpl.java +++ b/src/main/java/com/wooribound/domain/wbuser/WbUserServiceImpl.java @@ -109,25 +109,7 @@ public WbUserUpdateDTO updateUserInfo(WbUserUpdateDTO wbUserUpdateDTO) { .build()) .orElseThrow(() -> new NoWbUserException("사용자를 찾을 수 없습니다. ID: " + wbUserUpdateDTO.getUserId())); - // 사용자 정보 업데이트 - if (wbUserUpdateDTO.getName() != null) { - user.setName(wbUserUpdateDTO.getName()); - } - if (wbUserUpdateDTO.getPhone() != null) { - user.setPhone(wbUserUpdateDTO.getPhone()); - } - if (wbUserUpdateDTO.getGender() != null) { - user.setGender(wbUserUpdateDTO.getGender()); - } - if (wbUserUpdateDTO.getAddrCity() != null) { - user.setAddrCity(wbUserUpdateDTO.getAddrCity()); - } - if (wbUserUpdateDTO.getAddrProvince() != null) { - user.setAddrProvince(wbUserUpdateDTO.getAddrProvince()); - } - if (wbUserUpdateDTO.getExjobChk() != null) { - user.setExjobChk(wbUserUpdateDTO.getExjobChk()); - } + user.setExjobChk(wbUserUpdateDTO.getExjobChk()); // 관심 직종 업데이트 if (wbUserUpdateDTO.getInterestJobs() != null) { @@ -144,6 +126,25 @@ public WbUserUpdateDTO updateUserInfo(WbUserUpdateDTO wbUserUpdateDTO) { WbUser updatedUser = wbUserRepository.findByUserId(user.getUserId()) .orElseThrow(() -> new NoWbUserException("업데이트 후 사용자 조회 실패: ID: " + user.getUserId())); + // 사용자 정보 업데이트 + if (wbUserUpdateDTO.getName() != null) { + updatedUser.setName(wbUserUpdateDTO.getName()); + } + if (wbUserUpdateDTO.getPhone() != null) { + updatedUser.setPhone(wbUserUpdateDTO.getPhone()); + } + if (wbUserUpdateDTO.getGender() != null) { + updatedUser.setGender(wbUserUpdateDTO.getGender()); + } + if (wbUserUpdateDTO.getAddrCity() != null) { + updatedUser.setAddrCity(wbUserUpdateDTO.getAddrCity()); + } + if (wbUserUpdateDTO.getAddrProvince() != null) { + updatedUser.setAddrProvince(wbUserUpdateDTO.getAddrProvince()); + } + if (wbUserUpdateDTO.getExjobChk() != null) { + } + // 최종 저장 wbUserRepository.save(updatedUser);