Skip to content

Commit

Permalink
refactor: 게시글(file) 업데이트 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Nov 21, 2024
1 parent 4f46cf3 commit d4a5f61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public record Save(
public record Update(
@NotNull String title,
@NotNull String content,
@Valid List<@NotNull FileUpdateRequest> files
@Valid List<@NotNull FileSaveRequest> files
){}

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ public void update(Long postId, PostDTO.Update dto, Long userId) {
Post post = validateOwner(postId, userId);

List<File> fileList = getFiles(postId);
fileDeleteService.delete(fileList);

fileUpdateService.updateFiles(fileList, dto.files());
List<File> files = fileMapper.toFileList(dto.files(), post);
fileSaveService.save(files);

postUpdateService.update(post, dto);
}
Expand Down

0 comments on commit d4a5f61

Please sign in to comment.