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:
@@ -3,10 +3,10 @@ import {
|
||||
IsObject,
|
||||
IsString
|
||||
} from "class-validator";
|
||||
import { RunnerGroup } from '../entities/RunnerGroup';
|
||||
import { RunnerTeam } from '../entities/RunnerTeam';
|
||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
|
||||
import { IResponse } from './IResponse';
|
||||
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
|
||||
|
||||
/**
|
||||
* Defines the team stats response.
|
||||
@@ -47,7 +47,7 @@ export class ResponseStatsTeam implements IResponse {
|
||||
* The teams's parent group.
|
||||
*/
|
||||
@IsObject()
|
||||
parent: RunnerGroup;
|
||||
parent: ResponseRunnerGroup;
|
||||
|
||||
/**
|
||||
* Creates a new team stats response from a team
|
||||
@@ -56,7 +56,7 @@ export class ResponseStatsTeam implements IResponse {
|
||||
public constructor(team: RunnerTeam) {
|
||||
this.name = team.name;
|
||||
this.id = team.id;
|
||||
this.parent = team.parentGroup;
|
||||
this.parent = team.parentGroup.toResponse();
|
||||
this.distance = team.distance;
|
||||
this.donationAmount = team.distanceDonationAmount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user