Skip to content

Commit

Permalink
Hotfix: 채팅 조회 API 해당하는 채팅 없을 때 빈 리스트 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
nonaninona committed Feb 19, 2024
1 parent 7b77cf4 commit 643c1b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/kuit/chatdiary/service/ChatService.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -74,7 +75,7 @@ public List<ChatGetResponseDTO> getChats(Long userId, Long lastChatId) {
List<Chat> chats = chatRepository.findTop10ByUserIdAndChatIdGreaterThanOrderByChatIdDesc(userId, lastChatId);
System.out.println(chats);
if (chats.isEmpty()) {
return null;
return new ArrayList<>();
}
return chats.stream()
.map(ChatGetResponseDTO::new)
Expand Down

0 comments on commit 643c1b0

Please sign in to comment.