Skip to content

Commit f388ec7

Browse files
authored
Merge pull request #53 from oodd-team/OD-38-new
페이징 예외 수정
2 parents b732e19 + 4bc9ffb commit f388ec7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/post/post.controller.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ export class PostController {
5454
@Query('userId') userId?: number,
5555
): Promise<
5656
BaseResponse<
57-
(GetAllPostsResponse | GetMyPostsResponse | GetOtherPostsResponse) & {
57+
(
58+
| GetAllPostsResponse
59+
| GetMyPostsResponse
60+
| GetOtherPostsResponse
61+
| { posts: []; meta: PageMetaDto }
62+
) & {
5863
meta: PageMetaDto;
5964
}
6065
>
@@ -89,7 +94,10 @@ export class PostController {
8994
pageMetaDto.last_page >= 1 &&
9095
pageMetaDto.last_page < pageMetaDto.page
9196
) {
92-
throw DataNotFoundException('해당 페이지는 존재하지 않습니다');
97+
return new BaseResponse(false, '해당 페이지는 존재하지 않습니다', {
98+
posts: [],
99+
meta: pageMetaDto,
100+
});
93101
}
94102

95103
return new BaseResponse(true, '게시글 리스트 조회 성공', {

0 commit comments

Comments
 (0)