Skip to content
Snippets Groups Projects
Commit c8bf1900 authored by L4168's avatar L4168
Browse files

added nestedvalidation centerJSON

parent ee29e3c6
No related branches found
No related tags found
3 merge requests!59Development to master,!31Development,!29Json validation
......@@ -7,11 +7,15 @@ import {
Validate,
Min,
Max,
ValidateNested,
Allow,
} from 'class-validator';
import { ObjectivePointEntity } from './game.entity';
import { CenterJSON } from '../shared/custom-validation';
import { FactionDTO } from '../faction/faction.dto';
import { CenterDTO } from './game.json.dto';
import { Type } from 'class-transformer';
export class GameDTO {
@IsString()
......@@ -22,9 +26,12 @@ export class GameDTO {
@Length(1, 255)
desc: string;
@IsNotEmpty()
@Validate(CenterJSON)
center: JSON;
@ValidateNested()
@Type(() => CenterDTO)
center: CenterDTO;
@Allow()
map?: JSON;
@Allow()
nodesettings?: JSON;
@IsDateString()
@IsNotEmpty()
......@@ -32,7 +39,9 @@ export class GameDTO {
@IsDateString()
@IsNotEmpty()
enddate: string;
@Allow()
factions?: FactionDTO[];
@Allow()
objective_points?: FlagboxDTO[];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment