Skip to content

Commit 5c9c0ff

Browse files
committed
fix: 쪽지 읽음처리 서비스 레이어 수정
- @Transactinal의 추가로 일부 메서드 쓰기 연산 허용
1 parent ce6cda5 commit 5c9c0ff

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/main/java/com/somemore/note/service/NoteMarkAsReadService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class NoteMarkAsReadService implements NoteMarkAsReadUseCase {
2121
public void noteMarkAsRead(Long noteId) {
2222
Note note = getNote(noteId);
2323
note.markAsRead();
24+
noteRepository.save(note);
2425
}
2526

2627
private Note getNote(Long noteId) {

src/main/java/com/somemore/note/service/NoteQueryService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public Page<NoteReceiverViewForVolunteer> getNotesForVolunteer(UUID volunteerId,
3636
return noteRepository.findNotesByReceiverIsVolunteer(volunteerId, pageable);
3737
}
3838

39+
@Transactional
3940
@Override
4041
public NoteDetailViewForCenter getNoteDetailForCenter(Long noteId) {
4142
noteMarkAsReadUseCase.noteMarkAsRead(noteId);
@@ -44,6 +45,7 @@ public NoteDetailViewForCenter getNoteDetailForCenter(Long noteId) {
4445
.orElseThrow(() -> new NoSuchElementException(NOT_EXISTS_NOTE));
4546
}
4647

48+
@Transactional
4749
@Override
4850
public NoteDetailViewForVolunteer getNoteDetailForVolunteer(Long noteId) {
4951
noteMarkAsReadUseCase.noteMarkAsRead(noteId);

0 commit comments

Comments
 (0)