From 12498ac6eb3dc93fa50f4713cf23149f346cac51 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 23 Feb 2026 12:47:57 -0600 Subject: [PATCH] modified messages --- src/alumno/student.service.ts | 12 ++++++------ src/alumno_inscrito/alumno_inscrito.service.ts | 2 +- src/user/user.module.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/alumno/student.service.ts b/src/alumno/student.service.ts index 110a470..3e5ae98 100644 --- a/src/alumno/student.service.ts +++ b/src/alumno/student.service.ts @@ -1,4 +1,4 @@ -import { ConflictException, forwardRef, Inject, Injectable, NotFoundException } from '@nestjs/common'; +import { ConflictException, ForbiddenException, forwardRef, Inject, Injectable, NotFoundException } from '@nestjs/common'; import { CreateStudentDto } from './dto/create-student.dto'; import { Alumno } from './entities/student.entity'; import { EntityManager, Repository } from 'typeorm'; @@ -36,12 +36,12 @@ export class AlumnoService { throw new NotFoundException(`Carrera not found`); } - const currenStudent = await this.studentRepository.findOne({where:{id_cuenta:data.id_cuenta}}) + const currenStudent = await this.studentRepository.findOne({ where: { id_cuenta: data.id_cuenta } }) - if(currenStudent){ + if (currenStudent) { throw new ConflictException('El usuario ya existe') } - + const createStudent = { ...rest, carrera, fecha_registro: new Date() }; const student = this.studentRepository.create(createStudent); @@ -61,7 +61,7 @@ export class AlumnoService { return student; } - async findOneWhitSancion(id_cuenta: number): Promise { + async findOneWhitSancion(id_cuenta: number): Promise { const student = await this.studentRepository.findOne({ where: { id_cuenta }, select: { id_cuenta: true, nombre: true, credito: true }, @@ -73,7 +73,7 @@ export class AlumnoService { const sancion = await this.alumnoSancionService.findSancion(id_cuenta) if (sancion) { - throw new NotFoundException('El usuario se encuentra sancionado') + throw new ForbiddenException('El usuario se encuentra sancionado') } return student; diff --git a/src/alumno_inscrito/alumno_inscrito.service.ts b/src/alumno_inscrito/alumno_inscrito.service.ts index 352e318..5bb4226 100644 --- a/src/alumno_inscrito/alumno_inscrito.service.ts +++ b/src/alumno_inscrito/alumno_inscrito.service.ts @@ -99,7 +99,7 @@ export class AlumnoInscritoService { .getMany(); if (students.length === 0) { - throw new NotFoundException('Estudiante no Registrado'); + throw new NotFoundException('Estudiante no inscrito en el periodo actual'); } return students; diff --git a/src/user/user.module.ts b/src/user/user.module.ts index 8608164..e587a00 100644 --- a/src/user/user.module.ts +++ b/src/user/user.module.ts @@ -18,7 +18,7 @@ import { JwtStrategy } from './jwt.strategy'; return { global: true, secret: configService.get('JWT_SECRET'), - signOptions: { expiresIn: '1h' }, + signOptions: { expiresIn: '7h' }, }; }, }),