fix: add error handling to meetings + verband dashboard pages
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 5m47s
Workflow / ⚫️ Test (push) Has been skipped

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:
Zaid Marzguioui
2026-04-01 13:40:02 +02:00
parent 9484ba91f8
commit 4aa11cd408
3 changed files with 23 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ WORKDIR /app
# --- Install + Build in one stage ---
FROM base AS builder
# CACHE_BUST: change this value to force a full rebuild (busts Docker layer cache)
ARG CACHE_BUST=12
ARG CACHE_BUST=13
RUN echo "Cache bust: ${CACHE_BUST}"
COPY . .
RUN pnpm install --no-frozen-lockfile

View File

@@ -23,11 +23,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">

View File

@@ -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">