Skip to content

Commit 8085777

Browse files
committed
Fix: 게시물 무한스크롤 데이터 불러오기 #65
1 parent ef9a451 commit 8085777

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

components/pages/main/Feed/BoardsList/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default function BoardsList({
1919
Observer,
2020
data: boardList,
2121
isLoading,
22+
hasNextPage,
2223
} = useGetBoardList({
2324
infiniteQueryKey: ['boards'],
2425
});
@@ -42,7 +43,6 @@ export default function BoardsList({
4243
<FeedBoardCard
4344
userId={board.writer}
4445
content={board.content}
45-
// TODO: 이미지 연결
4646
imgs={board.fileNames}
4747
setShowModal={setShowModal}
4848
comments={board.replyListDto}
@@ -55,6 +55,7 @@ export default function BoardsList({
5555
),
5656
)
5757
)}
58+
{hasNextPage ? null : <div>🐾 더이상 게시물이 없어요 🐾</div>}
5859
<Observer>
5960
<div>로딩스피너...</div>
6061
</Observer>

hooks/queries/useGetBoardList.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ export default function useGetBoardList({
5151
Observer,
5252
data,
5353
isLoading,
54+
hasNextPage,
5455
};
5556
}

service/board.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default async function getBoardList({
2929
pageSize,
3030
}: TempPostListApiProps) {
3131
try {
32-
const url = `/endpoint/api/board/list?_page=${pageParam}&_limit=${pageSize}`;
32+
const url = `/endpoint/api/board/list?pageNumber=${pageParam}&pageSize=${pageSize}`;
3333
const response = await fetch(url);
3434
if (!response.ok) {
3535
throw new Error(`서버오류:${response.status}`);

0 commit comments

Comments
 (0)