Skip to content

Commit

Permalink
FEAT : 무한 스크롤 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
junvhui committed Feb 24, 2024
1 parent 140f1ea commit d6350ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ connectToMongoDB();

const PAGE_SIZE = 3;

app.get('/articles', async (req, res) => {
app.get('/article', async (req, res) => {
const pageNumber = req.query.pageNumber ? parseInt(req.query.pageNumber) : 1;

try {
Expand Down
2 changes: 1 addition & 1 deletion src/MainPage/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const Post = () => {
useEffect(() => {
const fetchData = async () => {
try {
const response = await axios.get(`/articles?pageNumber=${pageNumber}`);
const response = await axios.get(`/article?pageNumber=${pageNumber}`);
const newData = response.data.articles;
setArticleData((prevData) => [...prevData, ...newData]); // 기존 데이터와 새로운 데이터 결합
} catch (error) {
Expand Down

0 comments on commit d6350ac

Please sign in to comment.