Fix to Prod

This commit is contained in:
2025-10-01 11:59:15 -03:00
parent 63cc042eb4
commit e9b0eeb630
14 changed files with 155 additions and 30 deletions

View File

@@ -144,8 +144,24 @@ export const ResultadosRankingMunicipioWidget = () => {
<td className="sticky-col">{municipio.municipioNombre}</td>
{rankingData.categorias.flatMap(cat => {
const resCategoria = municipio.resultadosPorCategoria[cat.id];
const primerPuesto = resCategoria?.ranking[0];
const segundoPuesto = resCategoria?.ranking[1];
const primerPuestoRaw = resCategoria?.ranking[0];
const segundoPuestoRaw = resCategoria?.ranking[1];
// Asegurarse que los objetos tengan la propiedad 'votos'
const primerPuesto = primerPuestoRaw
? {
nombreCorto: primerPuestoRaw.nombreCorto,
porcentaje: primerPuestoRaw.porcentaje,
votos: 'votos' in primerPuestoRaw ? (primerPuestoRaw as any).votos : 0
}
: undefined;
const segundoPuesto = segundoPuestoRaw
? {
nombreCorto: segundoPuestoRaw.nombreCorto,
porcentaje: segundoPuestoRaw.porcentaje,
votos: 'votos' in segundoPuestoRaw ? (segundoPuestoRaw as any).votos : 0
}
: undefined;
return [
// --- Celdas para el 1° Puesto ---