diff --git a/src/components/election/Candidates.tsx b/src/components/election/Candidates.tsx index 9defc71..47273d2 100644 --- a/src/components/election/Candidates.tsx +++ b/src/components/election/Candidates.tsx @@ -163,7 +163,7 @@ export default function Candidates() { {users[candidate.uid].displayName} - Total Votes Received: {candidate.votes.length} + Total Votes Received: {candidate.vote_count} ) : ( diff --git a/src/lib/election.ts b/src/lib/election.ts index 67f243d..4157c31 100644 --- a/src/lib/election.ts +++ b/src/lib/election.ts @@ -46,4 +46,5 @@ export interface CandidateDocType { created_at: FieldValue; updated_at: FieldValue; votes: Array; + vote_count: number; }