Skip to content

Commit d787a1d

Browse files
CLAP-214 Hotfix : DeleteCategoryService 카테고리 삭제 로직 수정
* CLAP-110 Feature : 담당자별 작업 처리량 조회 API 구현 <footer> - 관련: #73 * CLAP-111 Refactor : 통계 조회 API 리팩토링 및 기능 수정 <footer> - 관련: #74 * 내 작업한 내용에 대한 설명 * 담당자 조회 API 구현 * CLAP-111 Refactor : 통계 조회 API 주소 통합, 리팩토링, 예외처리 <footer> - 관련: #74 * Bug : 프로퍼티파일 수정 * CLAP-104 CI/CD : CI에서 s3.yml 파일 생성하도록 수정 * CLAP-146 Feature : 카테고리 목록 조회 API 구현 <footer> - 관련: #118 * CLAP-147 Feature : 카테고리 수정 API 구현 <footer> - 관련: #119 * CLAP-147 Feature : 카테고리 추가, 수정 API 리뷰반영 수정 <footer> - 관련: #119 * CLAP-148 Feature : 카테고리 삭제 API 구현 <footer> - 관련: #120 * CLAP-148 Feature : 카테고리 삭제 API 수정 <footer> - 관련: #120 * CLAP-148 Docs : 카테고리 API 스웨거 수정 <footer> - 관련: #120 * CLAP-107 Bug : CI test yml파일 key 중복 수정 <footer> - 관련: #60 * CLAP-148 Feature : 카테고리 CUD 리뷰 반영 수정, 조회 반환 양식 수정 <footer> - 관련: #120 * CLAP-214 Cleanup : 통계, 카테고리 미흡한부분 리팩토링 <footer> - 관련: #216 * CLAP-214 Fix : 통계조회 API 파라미터 바인딩 오류 수정 <footer> - 관련: #216 * CLAP-214 Fix : addConverter 수정 <footer> - 관련: #216 * CLAP-214 Hotfix : 추가한 파일들 제거 <footer> - 관련: #216 * CLAP-214 Hotfix : FindStatisticsController 스위치문 수정 <footer> - 관련: #216 * CLAP-214 Hotfix : AddCategoryService 지연로딩 오류 수정 <footer> - 관련: #216 * CLAP-214 Hotfix : DeleteCategoryService 카테고리 삭제 로직 수정 <footer> - 관련: #216
1 parent 57e07e7 commit d787a1d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/main/java/clap/server/application/service/admin/DeleteCategoryService.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import clap.server.application.port.inbound.admin.DeleteCategoryUsecase;
44
import clap.server.application.port.inbound.domain.MemberService;
5+
import clap.server.application.port.outbound.task.CommandCategoryPort;
56
import clap.server.application.port.outbound.task.LoadCategoryPort;
67
import clap.server.common.annotation.architecture.ApplicationService;
78
import clap.server.domain.model.member.Member;
9+
import clap.server.domain.model.task.Category;
810
import clap.server.exception.ApplicationException;
911
import lombok.RequiredArgsConstructor;
1012
import org.springframework.transaction.annotation.Transactional;
@@ -16,13 +18,15 @@
1618
public class DeleteCategoryService implements DeleteCategoryUsecase {
1719
private final LoadCategoryPort loadCategoryPort;
1820
private final MemberService memberService;
21+
private final CommandCategoryPort commandCategoryPort;
1922

2023
@Override
2124
@Transactional
2225
public void deleteCategory(Long adminId, Long categoryId) {
2326
Member admin = memberService.findActiveMember(adminId);
24-
loadCategoryPort.findById(categoryId)
25-
.orElseThrow(() -> new ApplicationException(CATEGORY_NOT_FOUND))
26-
.deleteCategory(admin);
27+
Category category = loadCategoryPort.findById(categoryId)
28+
.orElseThrow(() -> new ApplicationException(CATEGORY_NOT_FOUND));
29+
category.deleteCategory(admin);
30+
commandCategoryPort.save(category);
2731
}
2832
}

0 commit comments

Comments
 (0)