Skip to content

Payments view implements client-side sort instead of server-side #265

Description

@usmanimamu17-create

The payments view (src/components/payments/payments-view.tsx) fetches paginated data from the backend but implements sorting client-side via toggleSort and sortedItems useMemo. This means only the current page's items are sorted, not the entire dataset. Users viewing paginated payments will see incorrect sort orders when the dataset spans multiple pages.

Root cause: Lines 113-125 in src/components/payments/payments-view.tsx - Client-side sort only sorts current page.

Why this is architecturally hard

  1. Backend API supports server-side sorting but frontend service layer doesn't expose sort parameters
  2. Changing to server-side sort requires updating API call, service interface, and component state
  3. Current UI uses loading state only triggered on filter changes, not sort changes

Acceptance criteria

  • Sorting payments by Amount, Date, or Status sorts the entire dataset
  • Sort parameters passed to backend API
  • Loading indicator appears while sorted data is fetched

Getting started

Files: src/components/payments/payments-view.tsx, src/services/paymentService.ts

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or requestperformanceissue-tracking

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions