diff --git a/packages/admin-portal/src/components/dashboard/election/Dashboard.tsx b/packages/admin-portal/src/components/dashboard/election/Dashboard.tsx index a779d1bce27..9697067fb0b 100644 --- a/packages/admin-portal/src/components/dashboard/election/Dashboard.tsx +++ b/packages/admin-portal/src/components/dashboard/election/Dashboard.tsx @@ -27,7 +27,11 @@ const Container = styled(Box)` justify-content: space-between; ` -export default function DashboardElection() { +interface DashboardElectionProps { + refreshRef?: React.RefObject +} + +export default function DashboardElection({refreshRef}: DashboardElectionProps) { const {i18n} = useTranslation() const [tenantId] = useTenantStore() const {globalSettings} = useContext(SettingsContext) @@ -49,7 +53,11 @@ export default function DashboardElection() { // Ensure required parameters are set before running the query. const canQueryStats = Boolean(tenantId && record?.election_event_id && record?.id) - const {loading, data: dataStats} = useQuery(GET_ELECTION_STATS, { + const { + loading, + data: dataStats, + refetch: doRefetch, + } = useQuery(GET_ELECTION_STATS, { variables: { tenantId, electionEventId: record?.election_event_id, @@ -83,6 +91,13 @@ export default function DashboardElection() { return ( +