Skip to content

Refresh All RSVPs after submitting and skip the unauthorized list fetch - #110

Open
NathanLe2247 wants to merge 1 commit into
candiedoperation:masterfrom
NathanLe2247:fix/rsvp-list-refresh
Open

NathanLe2247 wants to merge 1 commit into
candiedoperation:masterfrom
NathanLe2247:fix/rsvp-list-refresh

Conversation

@NathanLe2247

Copy link
Copy Markdown

What

Two bugs on the event Attendance page (EventAttendance.tsx):

  1. All RSVPs doesn't update after you RSVP. submitRsvp refetched only your own RSVP (/rsvp) for the "Your RSVP" card and never reloaded the list (/rsvps). You had to leave the page and come back to see your entry.
  2. Error toast for users without event management permission. The page-change effect ran refreshList() on first render for everyone. /rsvps requires @Security("events"), so other users got a "Failed to fetch RSVPs" toast every time they opened an event. Managers fetched page 1 twice, since load() already fetches it.

Fix

  • After a successful submit, call refreshList() when the list is shown (showRsvps).
  • Only run refreshList() in the page-change effect when showRsvps is true. On first render it is still false, so load() is the only fetch; page changes work as before.

The list is sorted by updatedAt descending, so a new or updated RSVP appears at the top of page 1.

Verified

  • ./nx build pplui passes.
  • ESLint reports the same 12 existing problems in this file as on master; none are new.
  • Prettier check passes.
  • Not yet tested in the browser as a user without event permissions.

🤖 Generated with Claude Code

After a user submitted or updated their RSVP, only the "Your RSVP" card
refreshed, so the All RSVPs list stayed stale until the page was reopened.
Now the list is refetched after a successful submit for users who can see it.

The page-change effect also ran on first render for every user. Users
without event management permission got a "Failed to fetch RSVPs" toast,
and managers fetched page 1 twice. It now only fetches when the list is shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant