Skip to content

Commit

Permalink
fix : not-recruit일때 지원 파트 size감소 안되게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sycuuui committed Feb 18, 2024
1 parent f2dfb6f commit a5fc605
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,16 @@ public void updateRecruit(Long apply_id, Boolean isRecruit){
if(!apply.getIsDecision()){
apply.setIsPass(isRecruit);
apply.setIsDecision(true);
Post post = apply.getPost();
//지원 파트 size 감소
Category category = categoryRepository.findCategoryByPostAndCategoryType(post, CategoryType.valueOf(apply.getRecruit_part()));
System.out.println("null"+",post:"+post+",categroy:"+apply.getRecruit_part());
if(category.getSize()-1<=0){
throw new ApplicationException(ErrorCode.OVER_APPLY_EXCEPTION);
}else {
category.setSize(category.getSize()-1);
if(isRecruit){
Post post = apply.getPost();
//지원 파트 size 감소
Category category = categoryRepository.findCategoryByPostAndCategoryType(post, CategoryType.valueOf(apply.getRecruit_part()));
System.out.println("null"+",post:"+post+",categroy:"+apply.getRecruit_part());
if(category.getSize()-1<=0){
throw new ApplicationException(ErrorCode.OVER_APPLY_EXCEPTION);
}else {
category.setSize(category.getSize()-1);
}
}
}else {
throw new ApplicationException(ErrorCode.ALREADY_DECISION_EXCEPION);
Expand Down

0 comments on commit a5fc605

Please sign in to comment.