Skip to content

Added pagination for getting event attendees in the dashboard#2145

Merged
maernest04 merged 2 commits intodevfrom
ernest_ma/add_pagination_to_attendees_view
May 5, 2026
Merged

Added pagination for getting event attendees in the dashboard#2145
maernest04 merged 2 commits intodevfrom
ernest_ma/add_pagination_to_attendees_view

Conversation

@maernest04
Copy link
Copy Markdown
Collaborator

@maernest04 maernest04 commented May 4, 2026

PR for #2117

Problem

The EventAttendeesDashboard previously lacked pagination support, making it difficult to manage and view attendees for events with a large number of registrations. Furthermore, the dashboard was susceptible to race conditions and unnecessary network traffic when users interacted with the interface quickly, as there was no mechanism to cancel outdated API requests.

Solution

  • Implemented Pagination: Introduced registrationsOffset state to track the current page and added "Previous" and "Next" navigation controls. The dashboard now fetches attendees in batches of 100.
  • Added Request Cancellation: Integrated AbortController into the data-fetching hooks. This ensures that if a user navigates away or triggers a new fetch before the previous one completes, the outdated request is cancelled to prevent state inconsistencies.
  • Enhanced API Functions: Updated getEventRegistrations and getEventRegistrationByRequestId in the SCEvents API utility to accept and respect AbortSignal.
  • Improved UI Feedback: Added a pagination status indicator (e.g., "1–100 of 500") and ensured navigation buttons are appropriately disabled during loading or when at the boundaries of the list.

Files Changed

  • src/APIFunctions/SCEvents.js: Updated API call wrappers to support request aborting and handle AbortError gracefully.
  • src/Pages/Events/EventAttendeesDashboard.js: Implemented pagination logic, navigation handlers, and request lifecycle management with AbortController.

Screenshots

First Page

Screenshot 2026-05-04 at 8 13 51 PM

Second Page

Screenshot 2026-05-04 at 8 14 19 PM

Copy link
Copy Markdown
Collaborator

@steeevin88 steeevin88 left a comment

Choose a reason for hiding this comment

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

did you test this?

@maernest04 maernest04 merged commit 94d6215 into dev May 5, 2026
4 checks passed
@maernest04 maernest04 deleted the ernest_ma/add_pagination_to_attendees_view branch May 5, 2026 03:41
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.

3 participants