Skip to content

Comments

fix page selector bug#36

Merged
technologic-technologic merged 1 commit intogen-aifrom
34-fix-page-selector-bug
Oct 16, 2025
Merged

fix page selector bug#36
technologic-technologic merged 1 commit intogen-aifrom
34-fix-page-selector-bug

Conversation

@technologic-technologic
Copy link
Owner

Updated the fallback value for the pages response from Api. More info below

Updated the fallback value for the pages response from Api

Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
@github-actions
Copy link

Pull Request Summary

WHAT Changed

  • Updated the setTotal function in DataContext.tsx to default to 1 instead of 50 when totalPages is not provided in the response.

WHY It Matters

  • This change ensures that the application correctly reflects the total number of pages available for products, preventing potential issues with pagination when the API does not return a totalPages value.

RISKS

  • If the API frequently returns a totalPages of 0 or is not properly configured, it may lead to unexpected behavior in pagination, potentially causing users to see fewer products than available.

TESTS to Add

  • Unit tests to verify that setTotal correctly sets the total pages to 1 when totalPages is not provided.
  • Integration tests to ensure that pagination behaves correctly with various API responses.

BREAKING CHANGES

  • No breaking changes introduced; however, the behavior of pagination may differ if the API response structure changes.

Changed File Paths

  • inventory-manager/src/context/DataContext.tsx

@technologic-technologic technologic-technologic added the bug Something isn't working label Oct 16, 2025
@technologic-technologic technologic-technologic merged commit 9e27b9f into gen-ai Oct 16, 2025
1 check passed
@technologic-technologic technologic-technologic deleted the 34-fix-page-selector-bug branch October 16, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix page selector showing 50+ pages on initial state with no data

1 participant