Added Event Module
This commit is contained in:
22
src/events/events.service.ts
Normal file
22
src/events/events.service.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { MyEvent } from 'src/dto/event.dto';
|
||||
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<MyEvent[]> {
|
||||
|
||||
return (await this.eventRepository.find()) as MyEvent[];
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user