Files
api-AT/src/equipo/equipo.controller.ts
T

35 lines
802 B
TypeScript
Raw Normal View History

2026-01-23 20:09:52 -06:00
import { Controller, Get, Param } from '@nestjs/common';
2025-09-24 18:37:56 -06:00
import { EquipoService } from './equipo.service';
2026-01-13 19:12:45 -06:00
import { Equipo } from './entities/equipo.entity';
2025-09-24 18:37:56 -06:00
@Controller('equipo')
export class EquipoController {
constructor(private readonly equipoService: EquipoService) {}
@Get()
2026-01-21 17:10:49 -06:00
findAll(): Promise<Equipo[]> {
2025-09-24 18:37:56 -06:00
return this.equipoService.findAll();
}
2026-01-23 20:09:52 -06:00
@Get('/active')
findActive() {
return this.equipoService.findActive();
}
@Get('/disable')
findDisable() {
return this.equipoService.findDisable();
}
2026-01-21 17:10:49 -06:00
@Get('/student/:id')
2026-01-23 20:09:52 -06:00
findOnlyUsable(@Param('id') id: number): Promise<Equipo[]> {
2026-01-21 17:10:49 -06:00
return this.equipoService.findOnlyUsable(+id);
}
2025-09-24 18:37:56 -06:00
@Get(':id')
2026-01-21 17:10:49 -06:00
findOne(@Param('id') id: number): Promise<Equipo> {
2025-09-24 18:37:56 -06:00
return this.equipoService.findOne(+id);
}
}
2026-01-21 17:10:49 -06:00
//IO