From 5c9c0ffef36d91cafa0c5feec5af99531796068a Mon Sep 17 00:00:00 2001 From: seojin Yoon <90759319+7zrv@users.noreply.github.com> Date: Mon, 9 Dec 2024 00:31:40 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=AA=BD=EC=A7=80=20=EC=9D=BD=EC=9D=8C?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=96=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - @Transactinal의 추가로 일부 메서드 쓰기 연산 허용 --- .../java/com/somemore/note/service/NoteMarkAsReadService.java | 1 + src/main/java/com/somemore/note/service/NoteQueryService.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/com/somemore/note/service/NoteMarkAsReadService.java b/src/main/java/com/somemore/note/service/NoteMarkAsReadService.java index 6557ae0b..41154e03 100644 --- a/src/main/java/com/somemore/note/service/NoteMarkAsReadService.java +++ b/src/main/java/com/somemore/note/service/NoteMarkAsReadService.java @@ -21,6 +21,7 @@ public class NoteMarkAsReadService implements NoteMarkAsReadUseCase { public void noteMarkAsRead(Long noteId) { Note note = getNote(noteId); note.markAsRead(); + noteRepository.save(note); } private Note getNote(Long noteId) { diff --git a/src/main/java/com/somemore/note/service/NoteQueryService.java b/src/main/java/com/somemore/note/service/NoteQueryService.java index 33ce8ec3..3604e7c3 100644 --- a/src/main/java/com/somemore/note/service/NoteQueryService.java +++ b/src/main/java/com/somemore/note/service/NoteQueryService.java @@ -36,6 +36,7 @@ public Page getNotesForVolunteer(UUID volunteerId, return noteRepository.findNotesByReceiverIsVolunteer(volunteerId, pageable); } + @Transactional @Override public NoteDetailViewForCenter getNoteDetailForCenter(Long noteId) { noteMarkAsReadUseCase.noteMarkAsRead(noteId); @@ -44,6 +45,7 @@ public NoteDetailViewForCenter getNoteDetailForCenter(Long noteId) { .orElseThrow(() -> new NoSuchElementException(NOT_EXISTS_NOTE)); } + @Transactional @Override public NoteDetailViewForVolunteer getNoteDetailForVolunteer(Long noteId) { noteMarkAsReadUseCase.noteMarkAsRead(noteId);