update tables if not eligible

This commit is contained in:
Danel Kungla
2025-10-06 11:07:39 +03:00
parent e7b7be7562
commit b3bea06d16
4 changed files with 108 additions and 19 deletions

View File

@@ -29,10 +29,13 @@ async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
const account = await api.getTeamAccount(accountSlug);
const { members } = await api.getMembers(accountSlug);
const eligibleMembersCount = members.filter(
({ is_eligible_for_benefits }) => !!is_eligible_for_benefits,
).length;
const [expensesOverview, companyParams] = await Promise.all([
loadTeamAccountBenefitExpensesOverview({
companyId: account.id,
employeeCount: members.length,
employeeCount: eligibleMembersCount,
}),
api.getTeamAccountParams(account.id),
]);
@@ -42,7 +45,7 @@ async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
<HealthBenefitForm
account={account}
companyParams={companyParams}
employeeCount={members.length}
employeeCount={eligibleMembersCount}
expensesOverview={expensesOverview}
/>
</PageBody>