import { Injectable } from '@nestjs/common' ; import { InjectRepository } from '@nestjs/typeorm' ; import { Repository } from 'typeorm' ; import { MediaEntity } from '../entities/media.entity' ; @ Injectable ( ) export class MediaService { constructor ( @ InjectRepository ( MediaEntity ) private readonly mediaRepository ) { } async find ( ) { return await this . mediaRepository . find ( ) ; } async findOne ( id ) { return await this . mediaRepository . findOne ( id ) ; } }