Cleaned up realations regarding response classes
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
ref #132
This commit is contained in:
@@ -11,10 +11,10 @@ import {
|
||||
} from "class-validator";
|
||||
import { Address } from '../entities/Address';
|
||||
import { RunnerOrganization } from '../entities/RunnerOrganization';
|
||||
import { RunnerTeam } from '../entities/RunnerTeam';
|
||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
|
||||
import { IResponse } from './IResponse';
|
||||
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
|
||||
import { ResponseRunnerTeam } from './ResponseRunnerTeam';
|
||||
|
||||
/**
|
||||
* Defines the runnerOrganization response.
|
||||
@@ -37,7 +37,7 @@ export class ResponseRunnerOrganization extends ResponseRunnerGroup implements I
|
||||
* The runnerOrganization associated teams.
|
||||
*/
|
||||
@IsArray()
|
||||
teams: RunnerTeam[];
|
||||
teams: ResponseRunnerTeam[];
|
||||
|
||||
/**
|
||||
* The organization's registration key.
|
||||
@@ -62,7 +62,13 @@ export class ResponseRunnerOrganization extends ResponseRunnerGroup implements I
|
||||
public constructor(org: RunnerOrganization) {
|
||||
super(org);
|
||||
this.address = org.address;
|
||||
this.teams = org.teams;
|
||||
this.teams = new Array<ResponseRunnerTeam>();
|
||||
if (org.teams) {
|
||||
for (let team of org.teams) {
|
||||
this.teams.push(team.toResponse());
|
||||
}
|
||||
}
|
||||
|
||||
if (!org.key) { this.registrationEnabled = false; }
|
||||
else { this.registrationKey = Buffer.from(org.key).toString('base64'); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user