diff --git a/e-voting-system/frontend/app/dashboard/votes/active/page.tsx b/e-voting-system/frontend/app/dashboard/votes/active/page.tsx index 316bacf..365a374 100644 --- a/e-voting-system/frontend/app/dashboard/votes/active/page.tsx +++ b/e-voting-system/frontend/app/dashboard/votes/active/page.tsx @@ -39,7 +39,12 @@ export default function ActiveVotesPage() { } const data = await response.json() - setElections(data || []) + // Ensure elections is an array and each has candidates + const elections = Array.isArray(data) ? data.map(e => ({ + ...e, + candidates: e.candidates || [] + })) : [] + setElections(elections) } catch (err) { const message = err instanceof Error ? err.message : "Erreur lors du chargement" setError(message)