35 lines
802 B
TypeScript
35 lines
802 B
TypeScript
import { Controller, Get, Param } 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('/active')
|
|
findActive() {
|
|
return this.equipoService.findActive();
|
|
}
|
|
|
|
@Get('/disable')
|
|
findDisable() {
|
|
return this.equipoService.findDisable();
|
|
}
|
|
|
|
@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
|