Motivation
The contact form (/senators/contact) fetches senators, districts, and leadership data in a single Promise.all. If any one of those three calls fails (for example, if no leadership has been configured yet), the entire batch is aborted and the senator dropdown is never populated — leaving "Speaker of the Senate" as the only selectable recipient, with no error surfaced to the user.
Deliverables
- Refactor
frontend/src/app/senators/contact/page.tsx to fetch senators, districts, and leadership independently (e.g. via Promise.allSettled or separate try/catch blocks) so that a failure in one does not block the others
- The senator dropdown should populate correctly even if the leadership or districts API call fails
Important Notes
- The speaker shown in the dropdown is looked up from the leadership API; if that call fails independently, the speaker label should gracefully fall back to the generic "Speaker of the Senate" text already present in the UI
Motivation
The contact form (
/senators/contact) fetches senators, districts, and leadership data in a singlePromise.all. If any one of those three calls fails (for example, if no leadership has been configured yet), the entire batch is aborted and the senator dropdown is never populated — leaving "Speaker of the Senate" as the only selectable recipient, with no error surfaced to the user.Deliverables
frontend/src/app/senators/contact/page.tsxto fetch senators, districts, and leadership independently (e.g. viaPromise.allSettledor separatetry/catchblocks) so that a failure in one does not block the othersImportant Notes