The nominee live pages were not working properly - they were loading but showing skeleton/loading state instead of actual nominee content.
The nominee page was implemented as a client-side component that fetched data via API calls, but the client-side fetch was failing or not completing properly, leaving the page stuck in the loading state.
-
Converted to Server-Side Rendering: Changed the nominee page from a client component to a server component that fetches data directly from the database during server-side rendering.
-
Fixed API Route: Updated the API route to use the
public_nomineesview instead of the rawnominationstable to get proper vote counts. -
Improved Data Structure: Enhanced the data transformation to include both nominee and company information properly.
- Converted from client component to server component
- Removed client-side fetch logic
- Added direct database query using Supabase server client
- Improved error handling with
notFound()for missing nominees
- Changed query from
nominationstable topublic_nomineesview - Added company information to the response
- Ensured vote counts are properly included
✅ All 46 approved nominee pages now load correctly ✅ Pages show proper nominee information including:
- Name, title, country
- Company information
- Vote counts
- "Why vote for me" content ✅ Server-side rendering ensures fast initial page loads ✅ Proper error handling for non-existent nominees
- Faster Loading: Server-side rendering eliminates client-side fetch delays
- Better SEO: Content is available immediately for search engines
- Improved UX: No more loading states or skeleton screens
- More Reliable: Direct database queries are more reliable than client-side API calls