create new ep delete programs
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Controller, Get, Post, Body, Patch, Param } from '@nestjs/common';
|
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||||
import { ProgramaService } from './programa.service';
|
import { ProgramaService } from './programa.service';
|
||||||
import { UpdateProgramaDto } from './dto/update-programa.dto';
|
import { UpdateProgramaDto } from './dto/update-programa.dto';
|
||||||
|
|
||||||
@@ -15,6 +15,7 @@ export class ProgramaController {
|
|||||||
findOne(@Param('id') id: string) {
|
findOne(@Param('id') id: string) {
|
||||||
return this.programaService.findOne(+id);
|
return this.programaService.findOne(+id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
create(@Body() body) {
|
create(@Body() body) {
|
||||||
return this.programaService.create(body);
|
return this.programaService.create(body);
|
||||||
@@ -25,4 +26,9 @@ export class ProgramaController {
|
|||||||
return this.programaService.update(+id, updateProgramaDto);
|
return this.programaService.update(+id, updateProgramaDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Delete(':id')
|
||||||
|
delete(@Param('id') id:string){
|
||||||
|
return this.programaService.delete(+id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ export class ProgramaService {
|
|||||||
await this.programaRepository.update(id, updateProgramaDto);
|
await this.programaRepository.update(id, updateProgramaDto);
|
||||||
return await this.findOne(id);
|
return await this.findOne(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async delete(id:number){
|
||||||
|
return this.programaRepository.delete(id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user