Files
pcpuma_unam_api/src/carrera-programa/carrera-programa.controller.ts
T

29 lines
860 B
TypeScript
Raw Normal View History

2022-04-24 19:09:22 -05:00
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common';
2022-04-04 20:53:32 -05:00
import { CarreraProgramaService } from './carrera-programa.service';
2022-04-22 13:36:18 -05:00
import { CarreraProgramaCreateDto } from './dto/carrera-programa-create.dto';
import { CarreraProgramaUpdateDto } from './dto/carrera-programa-update.dto';
2022-03-31 14:33:11 -06:00
@Controller('carrera-programa')
2022-04-04 20:53:32 -05:00
export class CarreraProgramaController {
constructor(private carreraProgramaService: CarreraProgramaService) {}
2022-04-17 20:47:35 -05:00
2022-04-17 20:56:02 -05:00
@Post()
2022-04-20 23:22:34 -05:00
create(@Body() body: CarreraProgramaCreateDto) {
2022-04-22 13:36:18 -05:00
return this.carreraProgramaService.create(
body.id_carrera,
body.id_programa,
);
2022-04-20 23:22:34 -05:00
}
2022-04-17 20:56:02 -05:00
2022-04-22 21:59:12 -05:00
// terminar delte
2022-04-24 19:09:22 -05:00
@Delete(':id')
delete(@Param('id') id_carrera_programa: number) {
return this.carreraProgramaService.delete(id_carrera_programa)
}
2022-04-17 20:56:02 -05:00
@Get()
2022-04-20 23:22:34 -05:00
get() {
2022-04-22 13:36:18 -05:00
return this.carreraProgramaService.findAll();
2022-04-20 23:22:34 -05:00
}
2022-04-04 20:53:32 -05:00
}