2024-06-15 17:09:19 -06:00
|
|
|
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Post, Put } from '@nestjs/common';
|
2024-06-14 14:33:27 -06:00
|
|
|
import { ProfesorService } from './profesor.service';
|
2024-06-14 15:33:11 -06:00
|
|
|
import { profesorDto } from './dto/profesorDto.dto';
|
2024-06-14 14:33:27 -06:00
|
|
|
|
|
|
|
|
@Controller('profesor')
|
2024-06-15 17:09:19 -06:00
|
|
|
export class ProfesorController {
|
|
|
|
|
constructor(private profesorService: ProfesorService) {}
|
2024-06-14 14:33:27 -06:00
|
|
|
|
2024-06-15 17:09:19 -06:00
|
|
|
@Post('alta')
|
|
|
|
|
async postRegister(@Body() data: profesorDto) {
|
|
|
|
|
return this.profesorService.register(data);
|
|
|
|
|
}
|
2024-06-14 14:33:27 -06:00
|
|
|
|
2024-06-15 17:09:19 -06:00
|
|
|
@Put('modificacion/:id_profesor')
|
|
|
|
|
async postModify(@Param('id_profesor', ParseIntPipe) id_profesor: number, @Body() data: profesorDto) {
|
|
|
|
|
return this.profesorService.modify(id_profesor, data);
|
|
|
|
|
}
|
2024-06-14 14:33:27 -06:00
|
|
|
|
2024-06-15 17:09:19 -06:00
|
|
|
@Delete('borrado/:id_profesor')
|
|
|
|
|
async remove(@Param('id_profesor', ParseIntPipe) id_profesor: number) {
|
|
|
|
|
return this.profesorService.remove(id_profesor);
|
|
|
|
|
}
|
2024-06-14 14:33:27 -06:00
|
|
|
|
2024-06-15 17:09:19 -06:00
|
|
|
@Get('profile/:id_profesor')
|
|
|
|
|
async profile(@Param('id_profesor', ParseIntPipe) id_profesor: number) {
|
|
|
|
|
return this.profesorService.profile(id_profesor);
|
|
|
|
|
}
|
2024-06-14 14:33:27 -06:00
|
|
|
|
2024-06-16 18:00:25 -06:00
|
|
|
@Post('filter')
|
2024-06-15 17:09:19 -06:00
|
|
|
async filter(@Body() data: profesorDto) {
|
|
|
|
|
return this.profesorService.filter(data);
|
|
|
|
|
}
|
2024-06-14 14:33:27 -06:00
|
|
|
}
|