added new Ep

This commit is contained in:
IO420
2025-10-02 17:03:25 -06:00
parent 7370e25e89
commit 7546de4a1b
13 changed files with 49 additions and 46 deletions
+5
View File
@@ -4,6 +4,11 @@ import { SancionService } from './sancion.service';
export class SancionController {
constructor(private readonly sancionService: SancionService) {}
@Get()
find() {
return this.sancionService.find();
}
@Get(':id')
findOne(@Param('id') id: number) {
return this.sancionService.findOne(+id);
+4
View File
@@ -10,6 +10,10 @@ export class SancionService {
private readonly sancionRepository: Repository<Sancion>,
) {}
async find(){
return this.sancionRepository.find()
}
async findOne(id_sancion: number): Promise<Sancion> {
const sancion = await this.sancionRepository.findOne({
where: { id_sancion },