fixed problems

This commit is contained in:
2025-12-04 16:17:32 -06:00
parent 2d5898d1af
commit 9c00e01f63
6 changed files with 8 additions and 14 deletions
@@ -1,4 +1,4 @@
import { IsDate, IsDateString, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';
import { IsDate, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';
export class CreateStudentDto {
@IsNotEmpty()
@@ -4,7 +4,6 @@ import { AlumnoInscritoController } from './alumno_inscrito.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AlumnoInscrito } from 'src/database/AT/entities/alumno_inscrito.entity';
import { PeriodoModule } from '../periodo/periodo.module';
import { PlataformaService } from '../plataforma/periodo.service';
import { PlataformaModule } from '../plataforma/periodo.module';
@Module({
+1 -2
View File
@@ -1,5 +1,4 @@
import { Controller, Get, Param } from '@nestjs/common';
import { PeriodoService } from './periodo.service';
import { Controller } from '@nestjs/common';
@Controller('periodo')
export class PeriodoController {}
@@ -1,9 +1 @@
import {
IsString,
Length,
IsDateString,
IsOptional,
IsBoolean,
} from 'class-validator';
export class PlataformaDto {}
@@ -1,4 +1,4 @@
import { Controller, Get, Param } from '@nestjs/common';
import { Controller, Get } from '@nestjs/common';
import { PlataformaService } from './periodo.service';
@Controller('plataforma')
@@ -8,6 +8,6 @@ export class PlataformaController {
//test
@Get()
GetPlataforma(){
return this.plataformaService.getByName("windows");
return this.plataformaService.getAll();
}
}
@@ -10,6 +10,10 @@ export class PlataformaService {
private readonly plataformaRepository: Repository<Plataforma>,
) {}
async getAll(){
return this.plataformaRepository.find()
}
async getByName(nombre: string): Promise<Plataforma> {
const plataforma = await this.plataformaRepository.findOne({
where: { nombre },