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);