added new Ep to servicio and periodo
This commit is contained in:
@@ -1,35 +1,12 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ServicioService } from './servicio.service';
|
||||
import { CreateServicioDto } from './dto/create-servicio.dto';
|
||||
import { UpdateServicioDto } from './dto/update-servicio.dto';
|
||||
|
||||
@Controller('servicio')
|
||||
export class ServicioController {
|
||||
constructor(private readonly servicioService: ServicioService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createServicioDto: CreateServicioDto) {
|
||||
return this.servicioService.create(createServicioDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.servicioService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.servicioService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateServicioDto: UpdateServicioDto) {
|
||||
return this.servicioService.update(+id, updateServicioDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.servicioService.remove(+id);
|
||||
}
|
||||
}
|
||||
//IO
|
||||
@@ -1,8 +1,11 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ServicioService } from './servicio.service';
|
||||
import { ServicioController } from './servicio.controller';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { Servicio } from './entities/servicio.entity';
|
||||
|
||||
@Module({
|
||||
imports:[TypeOrmModule.forFeature([Servicio])],
|
||||
controllers: [ServicioController],
|
||||
providers: [ServicioService],
|
||||
})
|
||||
|
||||
@@ -1,26 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreateServicioDto } from './dto/create-servicio.dto';
|
||||
import { UpdateServicioDto } from './dto/update-servicio.dto';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Servicio } from './entities/servicio.entity';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
@Injectable()
|
||||
export class ServicioService {
|
||||
create(createServicioDto: CreateServicioDto) {
|
||||
return 'This action adds a new servicio';
|
||||
}
|
||||
constructor(
|
||||
@InjectRepository(Servicio)
|
||||
private readonly ServicioRepository: Repository<Servicio>,
|
||||
) {}
|
||||
|
||||
findAll() {
|
||||
return `This action returns all servicio`;
|
||||
}
|
||||
|
||||
findOne(id: number) {
|
||||
return `This action returns a #${id} servicio`;
|
||||
}
|
||||
|
||||
update(id: number, updateServicioDto: UpdateServicioDto) {
|
||||
return `This action updates a #${id} servicio`;
|
||||
}
|
||||
|
||||
remove(id: number) {
|
||||
return `This action removes a #${id} servicio`;
|
||||
return this.ServicioRepository.find();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user