import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { Equipo } from './entities/equipo.entity'; @Injectable() export class EquipoService { constructor(@InjectRepository(Equipo) private readonly equipoRepository: Repository){} findAll() { return this.equipoRepository.find(); } async findOne(id_equipo: number):Promise { const equipo = await this.equipoRepository.findOne({where:{id_equipo}}) if(!equipo){ throw new NotFoundException("not found"); } return equipo; } } //IO