modified ranking

This commit is contained in:
2026-01-12 13:44:00 -06:00
parent 4a70ad3aa7
commit 0e9e179bd8
2 changed files with 3 additions and 4 deletions
-1
View File
@@ -358,7 +358,6 @@ export class EquipoController {
}
}
@Get('ranking/:year')
async ranking(@Param('year') year: string) {
return this.equipoService.ranking(Number(year));
+3 -3
View File
@@ -1088,14 +1088,14 @@ export class EquipoService {
for (const equipo of equipos) {
if (!equipo.mov || equipo.mov.length === 0) continue;
const movimientosDelAnno = equipo.mov.filter((mov) => {
const equipoyear = equipo.mov.filter((mov) => {
const fecha = new Date(mov.fechaMovimiento);
return fecha.getFullYear() === year;
});
if (movimientosDelAnno.length === 0) continue;
if (equipoyear.length === 0) continue;
const ultimoMov = movimientosDelAnno.sort(
const ultimoMov = equipoyear.sort(
(a, b) =>
new Date(b.fechaMovimiento).getTime() -
new Date(a.fechaMovimiento).getTime(),