diff --git a/app/api/src/games/games.controller.ts b/app/api/src/games/games.controller.ts index 686ebc8..66614b1 100644 --- a/app/api/src/games/games.controller.ts +++ b/app/api/src/games/games.controller.ts @@ -14,7 +14,7 @@ export class GamesController { return this.gameService.findAll({ limit, offset }); } - // /gametype/:gameId + // /gametype/:gametype @Get('gametype/:gametype') findByType(@Param('gametype') gametype: string) { return this.gameService.findByType(gametype); diff --git a/app/api/src/games/games.service.ts b/app/api/src/games/games.service.ts index 0fc6cc6..cc16933 100644 --- a/app/api/src/games/games.service.ts +++ b/app/api/src/games/games.service.ts @@ -28,7 +28,14 @@ export class GamesService { } async findByType(gametype: string) { - const game = await this.gamesRepository.find({ where: { gametype: gametype } }); + const game = await this.gamesRepository.find({ + where: { gametype: gametype }, + skip: 0, + take: 10, + order: { + gameId: 'DESC' + } + }); if (!game) { throw new NotFoundException(`Game Type: ${gametype} not found`); }