From a53d9ddabe24a91ba11dde55bf8e740b4c489740 Mon Sep 17 00:00:00 2001 From: Patriots01 <424018289@pcpum.acatlan.unam.mx> Date: Tue, 17 Feb 2026 22:32:20 +0000 Subject: [PATCH] Se actualizo la infromacion de comentarios y participantes en el orden de enviar la infromacion y se documento el campo de orden en carrusel, para no causar conflicto falta arreglar esta parte --- public/carrusel/{carrusel1.jpg => carrusel3.jpg} | Bin src/app.module.ts | 2 +- src/carrusel/carrusel.service.ts | 6 ++++++ src/carrusel/dto/carruselDto.dto.ts | 8 ++++---- src/carrusel/entity/carrusel.entity.ts | 5 ++--- src/comentarios/comentarios.service.ts | 2 ++ src/eventos/eventos.service.ts | 6 +++++- 7 files changed, 20 insertions(+), 9 deletions(-) rename public/carrusel/{carrusel1.jpg => carrusel3.jpg} (100%) diff --git a/public/carrusel/carrusel1.jpg b/public/carrusel/carrusel3.jpg similarity index 100% rename from public/carrusel/carrusel1.jpg rename to public/carrusel/carrusel3.jpg diff --git a/src/app.module.ts b/src/app.module.ts index 4e4e5a5..83aaa83 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -75,7 +75,7 @@ import { Almacenamiento } from './almacenamiento/entity/almacenamiento.entity'; username: configService.get('DB_USER'), password: configService.get('DB_PASSWORD'), database: configService.get('DB_NAME'), - synchronize: false, + synchronize: true, entities: [ Evento, Participante, diff --git a/src/carrusel/carrusel.service.ts b/src/carrusel/carrusel.service.ts index 18bf892..c17964d 100644 --- a/src/carrusel/carrusel.service.ts +++ b/src/carrusel/carrusel.service.ts @@ -111,6 +111,12 @@ export class CarruselService { } getAllImages(): Promise { + // return this.carruselRepository.find(); + // return this.carruselRepository.find({ + // order: { + // orden: 'ASC', + // }, + // }); return this.carruselRepository.find(); } diff --git a/src/carrusel/dto/carruselDto.dto.ts b/src/carrusel/dto/carruselDto.dto.ts index c1b1d78..274db68 100644 --- a/src/carrusel/dto/carruselDto.dto.ts +++ b/src/carrusel/dto/carruselDto.dto.ts @@ -1,4 +1,4 @@ -import { IsNotEmpty, IsOptional } from "class-validator"; +import { IsNotEmpty, IsOptional, IsNumber } from "class-validator"; export class carruselDto { @IsNotEmpty() @@ -7,7 +7,7 @@ export class carruselDto { @IsNotEmpty() link: string - // @IsNotEmpty() valida que no sea nulo ni undefined ni cadena vacĂ­a - @IsOptional() - orden?: string + // @IsOptional() + // @IsNumber() + // orden?: number } \ No newline at end of file diff --git a/src/carrusel/entity/carrusel.entity.ts b/src/carrusel/entity/carrusel.entity.ts index 4a1613f..650bb2c 100644 --- a/src/carrusel/entity/carrusel.entity.ts +++ b/src/carrusel/entity/carrusel.entity.ts @@ -13,7 +13,6 @@ export class Carrusel { link: string /* "https://www.acatlan.unam.mx/" */ - @Column({length: 20}) - orden: string - + // @Column({ type: 'int', default: 0 }) + // orden: number } \ No newline at end of file diff --git a/src/comentarios/comentarios.service.ts b/src/comentarios/comentarios.service.ts index a47965d..a56b818 100644 --- a/src/comentarios/comentarios.service.ts +++ b/src/comentarios/comentarios.service.ts @@ -54,6 +54,8 @@ export class ComentariosService { if (to) { query.andWhere('comentarios.fecha_registro <= :to', { to: new Date(to) }); } + + query.orderBy('comentarios.fecha_registro', 'DESC'); return await query.getMany(); } diff --git a/src/eventos/eventos.service.ts b/src/eventos/eventos.service.ts index 394fbe6..de74054 100644 --- a/src/eventos/eventos.service.ts +++ b/src/eventos/eventos.service.ts @@ -20,7 +20,11 @@ export class EventosService { ) {} getEventos() { - return this.eventoRepository.find(); + return this.eventoRepository.find({ + order: { + fecha_inicio: 'DESC', + }, + }); } public getEventosPorId(id: number) {