diff --git a/src/game/game.dto.ts b/src/game/game.dto.ts index e188acc97aea3162b6d364218a63d078a8e48edc..f47c0422feef5188cdf95a7b0e18b30f7c5c1ca2 100644 --- a/src/game/game.dto.ts +++ b/src/game/game.dto.ts @@ -4,8 +4,10 @@ import { Length, IsDateString, IsNumber, + Validate, } from 'class-validator'; import { ObjectivePointEntity } from './game.entity'; +import { CenterJSON } from '../shared/custom-validation'; export class GameDTO { @IsString() @@ -16,6 +18,7 @@ export class GameDTO { @Length(1, 255) desc: string; @IsNotEmpty() + @Validate(CenterJSON) center: JSON; map?: JSON; nodesettings?: JSON; @@ -39,6 +42,7 @@ export class newGameDTO { @Length(1, 255) desc: string; @IsNotEmpty() + @Validate(CenterJSON) center: JSON; @IsDateString() @IsNotEmpty()