diff --git a/ormconfig.json b/ormconfig.json index 2e271682f33485978ad86f39916a4d795b39e310..719a97dce0c749318ddfe718e83c062b6aa4114d 100644 --- a/ormconfig.json +++ b/ormconfig.json @@ -4,9 +4,9 @@ "port": 5444, "username": "postgres", "password": "mysecretpassword", - "database": "test", + "database": "test2", "entities": ["src/**/*.entity{.ts,.js}"], "synchronize": true, "logging": true, - "dropSchema": false + "dropSchema": true } diff --git a/src/draw/draw.controller.ts b/src/draw/draw.controller.ts index 19b9d271c0d51aea80deebbbf353d899b3c3c0a7..c721fc51fa418e8413c6993444b89cd361173f4c 100644 --- a/src/draw/draw.controller.ts +++ b/src/draw/draw.controller.ts @@ -43,8 +43,8 @@ export class DrawController { return this.drawService.drawMap(id, data); } - @Put('location') - @UseGuards(new AuthGuard()) - @UsePipes(new ValidationPipe()) - async trackLocation() {} + // @Put('location') + // @UseGuards(new AuthGuard()) + // @UsePipes(new ValidationPipe()) + // async trackLocation() {} } diff --git a/src/game/game.controller.ts b/src/game/game.controller.ts index bd6551ad714d9abbe172ef2a9be0d9301d8d79a6..cb0d2d6bd9f409741319014c3bf05a5f3c44f4c8 100644 --- a/src/game/game.controller.ts +++ b/src/game/game.controller.ts @@ -85,6 +85,11 @@ export class GameController { return this.gameservice.listGames(); } + @Get('get-faction-members/:id') + async getFactionMembers(@Param('id') factionId) { + return this.gameservice.listFactionMembers(factionId); + } + @Get(':id') async returnGameInfo(@Param('id') id: string) { return this.gameservice.returnGameInfo(id); diff --git a/src/game/game.service.ts b/src/game/game.service.ts index 571075290d777049db0a90e80a28b62e0f55e102..7356ceca6491d82c673c1c67de9be961dafa2861 100644 --- a/src/game/game.service.ts +++ b/src/game/game.service.ts @@ -199,6 +199,14 @@ export class GameService { }); } + async listFactionMembers(faction) { + return await this.game_PersonRepository.find({ + where: { faction }, + relations: ['person'], + order: { person: 'DESC' }, + }); + } + // returns information about a game identified by id async returnGameInfo(id: string) { const game = await this.gameRepository.findOne({