added new Ep
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user