Skip to content

Commit

Permalink
Merge pull request #62 from EFUB-ZEJE/feature/user-kakao-login
Browse files Browse the repository at this point in the history
Feature/user kakao login
  • Loading branch information
MINJU-KIMmm authored Sep 3, 2022
2 parents af73ca9 + 2ca8ef2 commit 97f7d19
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/ewha/efub/zeje/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public User saveUser(KakaoProfile kakaoProfile) {
user = kakaoProfile.toEntity();
userRepository.save(user);
}

if(user.getDeleteFlag()) {
throw new CustomException(ErrorCode.USER_NOT_FOUND);
}
return user;
}

Expand Down Expand Up @@ -93,11 +97,12 @@ public UserResponseDTO updateProfile(Long userId, String nickname, MultipartFil
}

public User getUserEntity(Long userId) {
try{
return userRepository.findByUserIdAndDeleteFlagFalse(userId);
}catch(Exception e) {
User user;
user = userRepository.findByUserIdAndDeleteFlagFalse(userId);
if(user == null) {
throw new CustomException(ErrorCode.USER_NOT_FOUND);
}
return user;
}

}

0 comments on commit 97f7d19

Please sign in to comment.