mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-01-19 17:34:43 +00:00
27 lines
755 B
TypeScript
27 lines
755 B
TypeScript
|
|
import { Injectable } from '@nestjs/common';
|
||
|
|
import { ConfigService } from '@nestjs/config';
|
||
|
|
import { Connection, Repository } from 'typeorm';
|
||
|
|
|
||
|
|
import { Games } from './entities/Games';
|
||
|
|
import { InjectRepository } from '@nestjs/typeorm';
|
||
|
|
import { PaginationQueryDto } from '../common/dto/pagination-query.dto';
|
||
|
|
|
||
|
|
@Injectable()
|
||
|
|
export class GamesService {
|
||
|
|
constructor(
|
||
|
|
private readonly connection: Connection,
|
||
|
|
private readonly configService: ConfigService,
|
||
|
|
@InjectRepository(Games) private readonly gamesRepository: Repository<Games>
|
||
|
|
) {}
|
||
|
|
|
||
|
|
async findAll(paginationQuery: PaginationQueryDto) {
|
||
|
|
const { limit, offset } = paginationQuery;
|
||
|
|
const games = await this.gamesRepository.find({
|
||
|
|
skip: offset,
|
||
|
|
take: limit
|
||
|
|
});
|
||
|
|
|
||
|
|
return games;
|
||
|
|
}
|
||
|
|
}
|