Cambios en las relaciones de evento, participante_evento y participante.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { IsString, MaxLength } from "class-validator";
|
||||
|
||||
export class CreateOpcionDto {
|
||||
|
||||
|
||||
@IsString()
|
||||
@MaxLength(50)
|
||||
opcion: string;
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { OpcionService } from './opcion.service';
|
||||
import { OpcionController } from './opcion.controller';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { Opcion } from './entities/opcion.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Opcion])], // Importa el repositorio de Opcion
|
||||
controllers: [OpcionController],
|
||||
providers: [OpcionService],
|
||||
exports: [OpcionService]
|
||||
})
|
||||
export class OpcionModule {}
|
||||
|
||||
@@ -12,12 +12,16 @@ export class OpcionService {
|
||||
private repository: Repository<Opcion>,
|
||||
){}
|
||||
|
||||
create(createOpcionDto: CreateOpcionDto) {
|
||||
return this.repository.save(createOpcionDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
create():Promise<Opcion> {
|
||||
return this.repository.save(this.repository.create());
|
||||
}
|
||||
|
||||
*/
|
||||
findAll() {
|
||||
return `This action returns all opcion`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user