Skip to content

Commit

Permalink
refactor: 공지사항 수정 로직 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Nov 22, 2024
1 parent d4a5f61 commit 1feab24
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 @@ -25,7 +25,7 @@ public record Save(
public record Update(
@NotNull String title,
@NotNull String content,
@Valid List<@NotNull FileUpdateRequest> files
@Valid List<@NotNull FileSaveRequest> files
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ public void update(Long noticeId, NoticeDTO.Update dto, Long userId) {
Notice notice = validateOwner(noticeId, userId);

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

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

noticeUpdateService.update(notice, dto);
}
Expand Down

0 comments on commit 1feab24

Please sign in to comment.