Skip to content

fix: pagination error fix#210

Merged
JAEJUN090210 merged 1 commit intomainfrom
feature/#209_pagination_error_fix
Dec 5, 2025
Merged

fix: pagination error fix#210
JAEJUN090210 merged 1 commit intomainfrom
feature/#209_pagination_error_fix

Conversation

@yunho09
Copy link
Copy Markdown
Member

@yunho09 yunho09 commented Dec 4, 2025

개요

페이지네이션 초기화되는 버그 수정

이슈 번호 209

변경사항

컴포넌트 마운트 됐을때 페이지네이션 초기화되서 리스트 꼬임 막음

페이지네이션 초기화되는 버그 수정
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a pagination bug where the page was being reset to 1 on every component mount, causing list display issues. The fix adds a conditional check to only reset pagination when the search term is not empty.

Key changes:

  • Modified pagination reset logic to conditionally trigger only when searchTerm is not empty
  • Removed unused use import (added but not utilized)
  • Code formatting improvements (consolidated multi-line statements)
Comments suppressed due to low confidence (1)

src/components/boardList/boardList.jsx:1

  • Unused import use.
import { useState, useEffect, use } from "react";

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,4 +1,4 @@
import { useState, useEffect } from "react";
import { useState, useEffect, use } from "react";
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use import from React is not used anywhere in this component. This import should be removed to keep the code clean.

Suggested change
import { useState, useEffect, use } from "react";
import { useState, useEffect } from "react";

Copilot uses AI. Check for mistakes.

useEffect(() => {
setCurrentPage(1);
if (searchTerm !== "") setCurrentPage(1);
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition if (searchTerm !== "") only resets pagination when search term is not empty. However, pagination should also reset when the user clears the search (searchTerm changes from non-empty to empty). Consider using a more comprehensive approach that resets pagination whenever searchTerm changes, or track the previous value to reset on any change.

Suggested change
if (searchTerm !== "") setCurrentPage(1);
setCurrentPage(1);

Copilot uses AI. Check for mistakes.
@JAEJUN090210 JAEJUN090210 merged commit 597f7c9 into main Dec 5, 2025
7 checks passed
@JAEJUN090210 JAEJUN090210 deleted the feature/#209_pagination_error_fix branch December 5, 2025 06:19
@JAEJUN090210 JAEJUN090210 mentioned this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

페이지네이션 오류 수정

3 participants