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

31 lines
835 B
TypeScript
Raw Normal View History

2022-04-20 23:22:34 -05:00
import { Body, Controller, Delete, Get, 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
@Delete()
delete() {}
@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-17 20:56:02 -05:00
@Put()
2022-04-20 23:22:34 -05:00
update(@Body() body: CarreraProgramaUpdateDto) {
2022-04-22 13:36:18 -05:00
return this.carreraProgramaService.update(body);
2022-04-20 23:22:34 -05:00
}
2022-04-04 20:53:32 -05:00
}