Skip to content

fix: search across all loaded articles#1361

Open
jyoti-5906 wants to merge 1 commit into
SB2318:mainfrom
jyoti-5906:fix/home-search-pagination
Open

fix: search across all loaded articles#1361
jyoti-5906 wants to merge 1 commit into
SB2318:mainfrom
jyoti-5906:fix/home-search-pagination

Conversation

@jyoti-5906

Copy link
Copy Markdown

Summary

This PR fixes a search issue in HomeScreen where handleSearch was filtering only articleData.articles, which contains the most recently fetched page of articles.

Since the application accumulates paginated articles in allArticlesRef.current, articles from previously loaded pages could be omitted from search results. The search logic has been updated to use allArticlesRef.current so that users can search across all loaded articles.

Changes Made

  • Updated handleSearch to search against allArticlesRef.current
  • Ensured search results include articles loaded from previous pages
  • Preserved existing search behavior for titles and tags

Type of Change

  • Bug fix (change which fixes an issue)

Select your work-area

  • Frontend

Related Issue

Fixes: #1358

Add your Work Example

Before:

  • Search only worked on the most recently fetched page.

After:

  • Search works across all loaded articles accumulated through pagination.

Fixes (mention the issue number which this fixes)

Closes #1358

Checklist

  • I have updated my branch and synced it with the project's 'develop' branch before making this PR.
  • I have optimized the file changes.
  • I have added a snapshot of my work example.
  • I have made a PR to the project's develop branch.

Undertaking

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have checked for plagiarism and assure its authenticity.
  • I have read and followed the code of conduct for this repository.
  • I Agree

@github-actions

Copy link
Copy Markdown
Contributor

Thank you @, for creating the PR and contributing to our UltimateHealth project 💗.
Our team will review the PR and will reach out to you soon! 😇
Make sure that you have marked all the tasks that you are done with ✅.
Thank you for your patience! 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞[Bug]: handleSearch in HomeScreen searches only the last-fetched page instead of all accumulated articles (allArticlesRef.current)

1 participant