41 lines
983 B
TypeScript
41 lines
983 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { CreateOpcionDto } from './dto/create-opcion.dto';
|
|
import { UpdateOpcionDto } from './dto/update-opcion.dto';
|
|
import { Opcion } from './entities/opcion.entity';
|
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
import { Repository } from 'typeorm';
|
|
|
|
@Injectable()
|
|
export class OpcionService {
|
|
constructor(
|
|
@InjectRepository(Opcion)
|
|
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`;
|
|
}
|
|
|
|
findOne(id: number) {
|
|
return `This action returns a #${id} opcion`;
|
|
}
|
|
|
|
update(id: number, updateOpcionDto: UpdateOpcionDto) {
|
|
return `This action updates a #${id} opcion`;
|
|
}
|
|
|
|
remove(id: number) {
|
|
return `This action removes a #${id} opcion`;
|
|
}
|
|
}
|