Skip to content

Commit

Permalink
hotfix: 탈퇴 이유 배열 0부터 시작되도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
dragontaek-lee committed Feb 13, 2024
1 parent 6366285 commit f6358fd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/java/com/gam/api/service/user/UserServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,20 +391,12 @@ private void createUserDeleteAccountReasons(List<Integer> DeleteAccountReasons,
val deleteAccountReasonList = deleteAccountReasonRepository.findAll();

for (Integer deleteAccountReason : DeleteAccountReasons){
if (deleteAccountReason < 1 || deleteAccountReason > deleteAccountReasonList.size()) {
if (deleteAccountReason < 0 || deleteAccountReason >= deleteAccountReasonList.size()) {
throw new IllegalArgumentException(ExceptionMessage.INVALID_DELETE_REASON.getMessage());
}
if (deleteAccountReason == deleteAccountReasonList.size()) {
userDeleteAccountReasonRepository.save(UserDeleteAccountReason.builder()
.user(user)
.deleteAccountReason(deleteAccountReasonList.get(deleteAccountReason-1))
.directInput(directInput)
.build());
continue;
}
userDeleteAccountReasonRepository.save(UserDeleteAccountReason.builder()
.user(user)
.deleteAccountReason(deleteAccountReasonList.get(deleteAccountReason - 1))
.deleteAccountReason(deleteAccountReasonList.get(deleteAccountReason))
.build());
}
user.setUserStatus(UserStatus.WITHDRAWAL);
Expand Down

0 comments on commit f6358fd

Please sign in to comment.