Skip to content

Commit ed71b51

Browse files
committed
feat: 게시글 리스트 조회 기능 수정
1 parent 44e9537 commit ed71b51

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/post/post.service.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ export class PostService {
7575
total,
7676
});
7777

78+
// totalPosts가 없을 경우 빈 배열 반환
79+
if (!totalPosts.length) {
80+
return new PageDto([], pageMetaDto);
81+
}
82+
7883
const last_page = pageMetaDto.last_page;
7984

8085
if (last_page < pageMetaDto.page) {
8186
throw DataNotFoundException('해당 페이지는 존재하지 않습니다');
8287
}
8388

84-
// totalPosts가 없을 경우 빈 배열 반환
85-
if (!totalPosts.length) {
86-
return new PageDto([], pageMetaDto);
87-
}
88-
8989
// 차단한 사용자 ID 목록 가져오기
9090
const blockedUserIds = currentUserId
9191
? await this.userBlockService.getBlockedUserIdsByRequesterId(

0 commit comments

Comments
 (0)