diff --git a/src/components/staff/approvals/hours-tab.tsx b/src/components/staff/approvals/hours-tab.tsx index e12fe0c..03e1aa9 100644 --- a/src/components/staff/approvals/hours-tab.tsx +++ b/src/components/staff/approvals/hours-tab.tsx @@ -43,6 +43,7 @@ export default function HoursTab({ async (id: number) => { const ok = await onApprove(id); if (ok) enqueueSnackbar("Hours approved", { variant: "success" }); + else enqueueSnackbar("Failed to approve hours", { variant: "error" }); }, [onApprove, enqueueSnackbar], ); diff --git a/src/services/analytics.service.ts b/src/services/analytics.service.ts index 08b47aa..3b20b85 100644 --- a/src/services/analytics.service.ts +++ b/src/services/analytics.service.ts @@ -171,7 +171,7 @@ export async function getExportData( .select({ name: sql`${users.firstName} || ' ' || ${users.lastName}`, totalHours: sql`coalesce(sum(${volunteerHours.hours}), 0)`, - verifiedHours: sql`coalesce(sum(${volunteerHours.hours}) filter (where ${volunteerHours.verifiedAt} is not null), 0)`, + verifiedHours: sql`coalesce(sum(${volunteerHours.hours}) filter (where ${volunteerHours.status} = 'approved'), 0)`, eventsAttended: sql`count(distinct ${volunteerHours.opportunityId})`, volunteerType: sql`coalesce(max(${volunteers.volunteerType}), 'Unspecified')`, })