From a1b8b9e9ab953d14bcf598ccbeddaec4b88ae659 Mon Sep 17 00:00:00 2001
From: L4168 <L4168@student.jamk.fi>
Date: Thu, 27 Jun 2019 17:00:05 +0300
Subject: [PATCH] added center validation to DTO

---
 src/game/game.dto.ts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/game/game.dto.ts b/src/game/game.dto.ts
index e188acc..f47c042 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()
-- 
GitLab