import { Injectable } from '@nestjs/common' ; import { InjectRepository } from '@nestjs/typeorm' ; import { Repository } from 'typeorm' ; import { EntityServiceOptions , extendOptions } from '@medium-stories/entities' ; import { EventEntity } from '../entities/event.entity' ; export const eventServiceOptions = { relations : [ 'image' ] } ; @ Injectable ( ) export class EventService { constructor ( @ InjectRepository ( EventEntity ) private readonly userRepository ) { } async find ( options ? ) { const payload = extendOptions ( eventServiceOptions , options ) ; return await this . userRepository . find ( payload ) ; } async findOne ( id , options ? ) { const payload = extendOptions ( eventServiceOptions , options ) ; return await this . userRepository . findOne ( id , payload ) ; } }