Ajout page statistiques

This commit is contained in:
Yannick Le Duc
2025-08-25 17:29:35 +02:00
parent 1f3d607e87
commit caed358661
3 changed files with 357 additions and 1 deletions

View File

@@ -242,6 +242,16 @@ export const voteService = {
if (error) throw error;
},
async getByCampaign(campaignId: string): Promise<Vote[]> {
const { data, error } = await supabase
.from('votes')
.select('*')
.eq('campaign_id', campaignId);
if (error) throw error;
return data || [];
},
async getParticipantVoteStatus(campaignId: string): Promise<ParticipantWithVoteStatus[]> {
const { data: participants, error: participantsError } = await supabase
.from('participants')