Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Related:
  • Loading branch information
L-U-Ready committed Nov 26, 2024
1 parent 4a5dda9 commit 77de0c2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 77de0c2

Please sign in to comment.