Skip to content

Commit

Permalink
feat : 관심 정책 등록 API 및 수혜 정책 등록 API 에서 처음 정책 등록시에 findUserPolicy Null 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Jan 2, 2024
1 parent 7d771b6 commit 19d4cdb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void saveInterestPolicy(User user, Long policyId) {
throw new BusinessException(ErrorCode.ALREADY_EXISTS_INTEREST_USER_POLICY);
}

if (findUserPolicy == null) {
if (findUserPolicy != null && findUserPolicy == null) {
findUserPolicy = UserPolicy.builder()
.user(findUser)
.policy(findPolicy)
Expand All @@ -78,7 +78,7 @@ public void saveApplyPolicy(User user, Long policyId) {
UserPolicy findUserPolicy = userPolicyRepository.findByUser_userIdAndPolicy_Id(findUser.getUserId(), findPolicy.getId())
.orElse(null);

if (findUserPolicy.isApplyFlag()) {
if (findUserPolicy != null && findUserPolicy.isApplyFlag()) {
throw new BusinessException(ErrorCode.ALREADY_EXISTS_INTEREST_USER_POLICY);
}

Expand Down

0 comments on commit 19d4cdb

Please sign in to comment.