From a5fc605ba3d9d758dec887fa699f6ce7d4dbc073 Mon Sep 17 00:00:00 2001 From: sycuuui <102959791+sycuuui@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:59:22 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20not-recruit=EC=9D=BC=EB=95=8C=20?= =?UTF-8?q?=EC=A7=80=EC=9B=90=20=ED=8C=8C=ED=8A=B8=20size=EA=B0=90?= =?UTF-8?q?=EC=86=8C=20=EC=95=88=EB=90=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/apply/service/ApplyService.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gongjakso/server/domain/apply/service/ApplyService.java b/src/main/java/com/gongjakso/server/domain/apply/service/ApplyService.java index 46836fda..4b3bed04 100644 --- a/src/main/java/com/gongjakso/server/domain/apply/service/ApplyService.java +++ b/src/main/java/com/gongjakso/server/domain/apply/service/ApplyService.java @@ -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);