Skip to content

Commit

Permalink
[hotfix]: 자료집 수정 카테고리
Browse files Browse the repository at this point in the history
  • Loading branch information
qogustj committed Oct 13, 2024
1 parent 8df84b5 commit 2b523e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public Long editBoardPost(String boardCode, Long postId, PostUpdateRequest postU
@Transactional
public Long editBoardDatePost(String fileCategory, Long postId, PostUpdateRequest postUpdateRequest){
Post post = postReader.getPostWithId(postId);
Post newPost = postModifier.updateDataPost(post, postUpdateRequest.categoryCode());
Post newPost = postModifier.updatePost(postUpdateRequest.toDataDomain(post));
postFileAppender.updatePostIdForIds(postUpdateRequest.postFileList(), newPost.getId(), FileCategory.fromString(fileCategory));
return post.getId();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,20 @@ public Post toDomain(Post post, Board board) {
board.getId()
);
}
public Post toDataDomain(Post post) {
return Post.of(
post.getId(),
title,
content,
post.getViewCount(),
thumbnailImage,
post.getStatus(),
DateUtils.parseHourMinSecFromCustomString(post.getCreatedAt()),
DateUtils.parseHourMinSecFromCustomString(post.getUpdatedAt()),
LocalDateTime.now(),
categoryCode,
post.getUserId(),
6L
);
}
}

0 comments on commit 2b523e5

Please sign in to comment.