diff --git a/frontend/interfaces/team.ts b/frontend/interfaces/team.ts index 797d48a6a..98f7fd64d 100644 --- a/frontend/interfaces/team.ts +++ b/frontend/interfaces/team.ts @@ -20,6 +20,7 @@ export interface ITeamSummary { id: number; name: string; description?: string; + host_count: number; } /** diff --git a/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/TeamDetailsWrapper.tsx b/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/TeamDetailsWrapper.tsx index bd25be7c3..d059ce235 100644 --- a/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/TeamDetailsWrapper.tsx +++ b/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/TeamDetailsWrapper.tsx @@ -350,8 +350,9 @@ const TeamDetailsWrapper = ({ ); } - const hostsCount = teams?.length || 1; - const hostsTotalDisplay = hostsCount === 1 ? "1 host" : `${hostsCount} hosts`; + const hostCount = currentTeam.host_count; + const hostsTotalDisplay = + hostCount >= 2 ? `${hostCount} hosts` : `${hostCount} host`; const userAdminTeams = userTeams.filter( (thisTeam) => thisTeam.role === "admin" );