22 lines
478 B
TypeScript
22 lines
478 B
TypeScript
import { Inject, Injectable } from '@nestjs/common';
|
|
import { Repository } from 'typeorm';
|
|
import { EventEntity } from './events.entity';
|
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
|
|
@Injectable()
|
|
export class EventsService {
|
|
constructor(
|
|
@InjectRepository(EventEntity)
|
|
private readonly eventRepository: Repository<EventEntity>
|
|
|
|
){}
|
|
|
|
async getEvents(): Promise<EventEntity[]> {
|
|
|
|
return (await this.eventRepository.find());
|
|
|
|
|
|
|
|
}
|
|
}
|