diff --git a/package-lock.json b/package-lock.json index fd2af0db0f3c47f7a96abd6b2847f5b6f33900a3..7e3168cd470c78829b618974540aa6e428ada73a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3106,8 +3106,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -3128,14 +3127,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3150,20 +3147,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -3280,8 +3274,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -3293,7 +3286,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3308,7 +3300,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3316,14 +3307,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3342,7 +3331,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -3423,8 +3411,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -3436,7 +3423,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -3522,8 +3508,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -3559,7 +3544,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3579,7 +3563,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3623,14 +3606,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, diff --git a/src/draw/draw.service.ts b/src/draw/draw.service.ts index 2d983c51f555752dfbd1ae2c7bf63a8a20a81270..88a1e4116f6b3dccc3c9f5412378f0d6761a78d0 100644 --- a/src/draw/draw.service.ts +++ b/src/draw/draw.service.ts @@ -20,6 +20,7 @@ export class DrawService { async draw(gameId, data: MapDrawingEntity) { data['gameId'] = gameId; + const drawing = await this.mapDrawingRepository.create(data); if (data.mapDrawingId == null || data.mapDrawingId == '') { diff --git a/src/game/game.controller.ts b/src/game/game.controller.ts index 86af40f5658d1b76e89cd5e01ab3a6d8d6614394..8f3fc988d39101362fae36fbd4dc0754208ab89e 100644 --- a/src/game/game.controller.ts +++ b/src/game/game.controller.ts @@ -66,7 +66,7 @@ export class GameController { @Get('get-faction-members/:id') async getFactionMembers(@Param('id') factionId) { - return this. gameservice.listFactionMembers(factionId) + return this.gameservice.listFactionMembers(factionId); } // param game ID is passed to @Roles @@ -90,11 +90,6 @@ 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.dto.ts b/src/game/game.dto.ts index 6460193fce2481385a90560bb36d2317cbdc13a9..d4acf7cd5baaf749e8c18ea4bf7a48bc3496caba 100644 --- a/src/game/game.dto.ts +++ b/src/game/game.dto.ts @@ -7,9 +7,10 @@ import { Validate, Min, Max, + IsUUID, } from 'class-validator'; -import { ObjectivePointEntity } from './game.entity'; -import { CenterJSON } from '../shared/custom-validation'; +import { GameEntity, ObjectivePointEntity } from './game.entity'; +import { CenterJSON, RoleValidation } from '../shared/custom-validation'; export class GameDTO { @IsString() diff --git a/src/game/game.service.ts b/src/game/game.service.ts index 76e7020eb6531760a439a3c3265d096f5fc8ce08..bce915d847e23055bf0a20d70486a3934e8aac21 100644 --- a/src/game/game.service.ts +++ b/src/game/game.service.ts @@ -241,14 +241,6 @@ export class GameService { this.notificationGateway.server.emit('flagbox', 'event update'); } - async listFactionMembers(faction) { - return await this.game_PersonRepository.find({ - where: { faction }, - relations: ['person'], - order: { person: 'DESC' }, - }); - } - async promotePlayer(body) { const gamepersonId = body.player; // get playerdata