33 lines
671 B
TypeScript
33 lines
671 B
TypeScript
import {
|
|
Controller,
|
|
Get,
|
|
Post,
|
|
Body,
|
|
Patch,
|
|
Param,
|
|
Delete,
|
|
} from '@nestjs/common';
|
|
import { EquipoService } from './equipo.service';
|
|
import { Equipo } from './entities/equipo.entity';
|
|
|
|
@Controller('equipo')
|
|
export class EquipoController {
|
|
constructor(private readonly equipoService: EquipoService) {}
|
|
|
|
@Get()
|
|
findAll(): Promise<Equipo[]> {
|
|
return this.equipoService.findAll();
|
|
}
|
|
|
|
@Get('/student/:id')
|
|
findOnlyUsable(@Param('id')id:number): Promise<Equipo[]> {
|
|
return this.equipoService.findOnlyUsable(+id);
|
|
}
|
|
|
|
@Get(':id')
|
|
findOne(@Param('id') id: number): Promise<Equipo> {
|
|
return this.equipoService.findOne(+id);
|
|
}
|
|
}
|
|
//IO
|