Skip to content

Commit

Permalink
fix: updated update method
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Dec 12, 2024
1 parent 16359c7 commit c19ec71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private int getCorrectionCount(long memberId) {
public void modifyDiary(long memberId, long diaryId, WriteDiaryRequest request) {
Diary foundDiary = diaryPort.findById(diaryId);
foundDiary.validateDiaryOwnership(memberId);
diaryPort.update(request.toDomain(foundDiary));
diaryPort.update(request.update(foundDiary));
correctionPort.deleteByDiary(diaryId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public Diary toDomain(Member member) {
.build();
}

public Diary toDomain(Diary originDiary) {
public Diary update(Diary originDiary) {
return Diary.builder()
.id(originDiary.getId())
.content(content)
.targetLang(originDiary.getTargetLang())
.topicId(topicId)
.topicId(originDiary.getTopicId())
.memberId(originDiary.getMemberId())
.build();
}
Expand Down

0 comments on commit c19ec71

Please sign in to comment.