3 Commits

Author SHA1 Message Date
santiago f02dd40d51 Se quito el orden para no causar conflicto 2026-02-09 12:22:33 -06:00
santiago b607cc2ccb Se quito el orden en los banners 2026-02-09 12:15:50 -06:00
santiago b5a832e179 Modificaciones 2026-02-09 12:13:50 -06:00
11 changed files with 25 additions and 47 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

+1 -1
View File
@@ -75,7 +75,7 @@ import { Almacenamiento } from './almacenamiento/entity/almacenamiento.entity';
username: configService.get('DB_USER'), username: configService.get('DB_USER'),
password: configService.get('DB_PASSWORD'), password: configService.get('DB_PASSWORD'),
database: configService.get('DB_NAME'), database: configService.get('DB_NAME'),
synchronize: true, synchronize: false,
entities: [ entities: [
Evento, Evento,
Participante, Participante,
-6
View File
@@ -7,7 +7,6 @@ import {
ParseIntPipe, ParseIntPipe,
Patch, Patch,
Post, Post,
Put,
Res, Res,
UploadedFile, UploadedFile,
UseInterceptors, UseInterceptors,
@@ -58,11 +57,6 @@ export class CarruselController {
return this.carruselService.updateImagenCarrusel(id, carruselDto); return this.carruselService.updateImagenCarrusel(id, carruselDto);
} }
@Put('updateOrden')
async updateOrden(@Body() banners: { id: number; orden: number}[]) {
return this.carruselService.updateOrden(banners);
}
@Delete('delete/:id') @Delete('delete/:id')
deleteImagenByRuta(@Param('id', ParseIntPipe) id: number) { deleteImagenByRuta(@Param('id', ParseIntPipe) id: number) {
return this.carruselService.deleteImagenByRuta(id); return this.carruselService.deleteImagenByRuta(id);
+1 -22
View File
@@ -95,21 +95,6 @@ export class CarruselService {
}); });
} }
} }
// Actualizar todas las imagenes por orden
async updateOrden(banners: { id: number; orden: number}[]) {
for (const banner of banners ) {
await this.carruselRepository.update(
{ id_imagen_carrusel: banner.id },
{ orden: banner.orden },
)
}
return {
message: 'Orden actualizado correctamente',
}
}
async deleteImagenByRuta(id: number) { async deleteImagenByRuta(id: number) {
try { try {
const res = await this.carruselRepository.findOne({ const res = await this.carruselRepository.findOne({
@@ -126,13 +111,7 @@ export class CarruselService {
} }
getAllImages(): Promise<Carrusel[]> { getAllImages(): Promise<Carrusel[]> {
// return this.carruselRepository.find(); return this.carruselRepository.find();
return this.carruselRepository.find({
order: {
orden: 'ASC',
},
});
// return this.carruselRepository.find();
} }
async deleteAllCarrusel(): Promise<{ message: string }> { async deleteAllCarrusel(): Promise<{ message: string }> {
+4 -4
View File
@@ -1,4 +1,4 @@
import { IsNotEmpty, IsOptional, IsNumber } from "class-validator"; import { IsNotEmpty, IsOptional } from "class-validator";
export class carruselDto { export class carruselDto {
@IsNotEmpty() @IsNotEmpty()
@@ -7,7 +7,7 @@ export class carruselDto {
@IsNotEmpty() @IsNotEmpty()
link: string link: string
@IsOptional() // @IsNotEmpty() valida que no sea nulo ni undefined ni cadena vacía
@IsNumber() // @IsOptional()
orden?: number // orden?: string
} }
+3 -2
View File
@@ -13,6 +13,7 @@ export class Carrusel {
link: string link: string
/* "https://www.acatlan.unam.mx/" */ /* "https://www.acatlan.unam.mx/" */
@Column({ type: 'int', default: 0 }) // @Column({length: 20})
orden: number // orden: string
} }
-2
View File
@@ -55,8 +55,6 @@ export class ComentariosService {
query.andWhere('comentarios.fecha_registro <= :to', { to: new Date(to) }); query.andWhere('comentarios.fecha_registro <= :to', { to: new Date(to) });
} }
query.orderBy('comentarios.fecha_registro', 'DESC');
return await query.getMany(); return await query.getMany();
} }
+1 -5
View File
@@ -20,11 +20,7 @@ export class EventosService {
) {} ) {}
getEventos() { getEventos() {
return this.eventoRepository.find({ return this.eventoRepository.find();
order: {
fecha_inicio: 'DESC',
},
});
} }
public getEventosPorId(id: number) { public getEventosPorId(id: number) {
@@ -1,6 +1,7 @@
import { import {
Body, Body,
Controller, Controller,
NotFoundException,
Post, Post,
} from '@nestjs/common'; } from '@nestjs/common';
import { InscripcionDscService } from './inscripcion-dsc.service'; import { InscripcionDscService } from './inscripcion-dsc.service';
@@ -13,15 +14,19 @@ export class InscripcionDscController {
@Post('confirmacion') @Post('confirmacion')
async confirmacionDsc(@Body() body: any) { async confirmacionDsc(@Body() body: any) {
const { accountNumber } = body; const { accountNumber } = body;
console.log('Entro a la confirmacion')
const userVerification = await this.inscripcionService.userVerification(accountNumber); const userVerification = await this.inscripcionService.userVerification(accountNumber);
/* console.log(userVerification) */ /* console.log(userVerification) */
console.log('Usuario verificacion', userVerification);
if(!userVerification){ if(!userVerification){
return { throw new NotFoundException('El usuario no se encuentra inscrito');
error: true,
msj: 'El usuario no se encuentra inscrito', // return {
desc: '', // error: true,
}; // msj: 'El usuario no se encuentra inscrito',
// desc: '',
// };
} }
const userInformation = userVerification; const userInformation = userVerification;
@@ -22,6 +22,8 @@ export class InscripcionDscService {
JOIN periodo P ON (P.id_periodo = AI.id_periodo) JOIN periodo P ON (P.id_periodo = AI.id_periodo)
WHERE A.id_cuenta = "${accountNumber}" and P.activo=true`; WHERE A.id_cuenta = "${accountNumber}" and P.activo=true`;
console.log('despues de el select', userInformationQuery)
const qryEjemplo = `SELECT * FROM alumno WHERE id_cuenta="${accountNumber}";`; const qryEjemplo = `SELECT * FROM alumno WHERE id_cuenta="${accountNumber}";`;
const [results] = await connection.query(userInformationQuery); const [results] = await connection.query(userInformationQuery);
@@ -30,8 +32,10 @@ export class InscripcionDscService {
/* console.log('The solution is: ', resultsArray); */ /* console.log('The solution is: ', resultsArray); */
console.log('The solution is: ', resultsArray); console.log('The solution is: ', resultsArray);
console.log('Resultados', results)
return results; return results;
} catch (error) { } catch (error) {
console.log('Entro al error', error)
throw error; throw error;
} finally { } finally {
if (connection) { if (connection) {
@@ -40,6 +44,7 @@ export class InscripcionDscService {
} }
} }
async userConfirmation(accountNumber: string): Promise<any> { async userConfirmation(accountNumber: string): Promise<any> {
try { try {
const connection = await createConnection({ const connection = await createConnection({