fix: add error handling to meetings + verband dashboard pages
SSR pages crash with 500 when Supabase queries fail (expired session, network issues). Now catch errors and render with empty data instead of crashing the entire page.
This commit is contained in:
@@ -22,7 +22,14 @@ export default async function VerbandPage({ params }: PageProps) {
|
||||
if (!acct) return <AccountNotFound />;
|
||||
|
||||
const api = createVerbandApi(client);
|
||||
const stats = await api.getDashboardStats(acct.id);
|
||||
|
||||
let stats = { totalClubs: 0, totalMembers: 0, totalRoles: 0, totalFeeTypes: 0 };
|
||||
|
||||
try {
|
||||
stats = await api.getDashboardStats(acct.id);
|
||||
} catch (e) {
|
||||
console.error('Failed to load verband dashboard:', e);
|
||||
}
|
||||
|
||||
return (
|
||||
<CmsPageShell account={account} title="Verbandsverwaltung">
|
||||
|
||||
Reference in New Issue
Block a user