Skip to content

Commit

Permalink
fix: 메시지 읽음처리
Browse files Browse the repository at this point in the history
메시지 읽음처리를 이미 읽은메시지도 요청해서 409응답 받음
messageList Provider내부라서 해결 가능했음
  • Loading branch information
5nxtnxtnxt committed Dec 12, 2023
1 parent 41df317 commit a7c1a94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion front/src/pages/Main/MainBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const MainBody = (): JSX.Element => {
if (messageID === 0) {
return;
}

const nowMsg = messageList.find(message => message.id === messageID);
if (nowMsg === undefined || nowMsg.opened !== null) {
return;
}
axios
.put(`/api/message/${messageID}/open`)
.then(() => {
Expand Down

0 comments on commit a7c1a94

Please sign in to comment.