diff --git a/src/main/java/the_monitor/application/serviceImpl/ReportServiceImpl.java b/src/main/java/the_monitor/application/serviceImpl/ReportServiceImpl.java index 2ce4873..57cb299 100644 --- a/src/main/java/the_monitor/application/serviceImpl/ReportServiceImpl.java +++ b/src/main/java/the_monitor/application/serviceImpl/ReportServiceImpl.java @@ -103,7 +103,9 @@ public String updateReportArticle(Long clientId, Long reportId, ReportArticleUpd Report report = findByClientIdAndReportId(clientId, reportId); validIsAccountAuthorizedForReport(getAccountFromId(getAccountId()), report); - ReportCategory reportCategory = setDefaultCategory(report); + ReportCategory reportCategory = setDefaultCategory(report, request.getCategoryType()); + + reportCategoryRepository.save(reportCategory); reportArticleRepository.save(request.toEntity(reportCategory)); @@ -391,9 +393,9 @@ private ReportCategoryListResponse buildCategoryListResponse(ReportCategory cate .build(); } - private ReportCategory setDefaultCategory(Report report) { + private ReportCategory setDefaultCategory(Report report, String categoryType) { return ReportCategory.builder() - .categoryType(CategoryType.SELF) + .categoryType(CategoryType.valueOf(categoryType)) .name("default") .description("기본 카테고리입니다.") .report(report)