Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -26,11 +26,20 @@ export default async function MeetingsPage({ params }: PageProps) {
|
||||
|
||||
const api = createMeetingsApi(client);
|
||||
|
||||
const [stats, recentProtocols, overdueTasks] = await Promise.all([
|
||||
api.getDashboardStats(acct.id),
|
||||
api.getRecentProtocols(acct.id),
|
||||
api.getOverdueTasks(acct.id),
|
||||
]);
|
||||
let stats = { totalProtocols: 0, thisYearProtocols: 0, openTasks: 0, overdueTasks: 0 };
|
||||
let recentProtocols: Awaited<ReturnType<typeof api.getRecentProtocols>> = [];
|
||||
let overdueTasks: Awaited<ReturnType<typeof api.getOverdueTasks>> = [];
|
||||
|
||||
try {
|
||||
[stats, recentProtocols, overdueTasks] = await Promise.all([
|
||||
api.getDashboardStats(acct.id),
|
||||
api.getRecentProtocols(acct.id),
|
||||
api.getOverdueTasks(acct.id),
|
||||
]);
|
||||
} catch (e) {
|
||||
// Supabase query failed — render with empty data instead of crashing
|
||||
console.error('Failed to load meetings dashboard:', e);
|
||||
}
|
||||
|
||||
return (
|
||||
<CmsPageShell account={account} title="Sitzungsprotokolle">
|
||||
|
||||
@@ -25,7 +25,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