Implemented the first route of the toResponse normalisationf for all classes
ref #67
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { IsNotEmpty } from "class-validator";
|
||||
import { ChildEntity, ManyToOne } from "typeorm";
|
||||
import { ResponseRunnerTeam } from '../responses/ResponseRunnerTeam';
|
||||
import { RunnerGroup } from "./RunnerGroup";
|
||||
import { RunnerOrganisation } from "./RunnerOrganisation";
|
||||
|
||||
@@ -17,4 +18,11 @@ export class RunnerTeam extends RunnerGroup {
|
||||
@IsNotEmpty()
|
||||
@ManyToOne(() => RunnerOrganisation, org => org.teams, { nullable: true })
|
||||
parentGroup?: RunnerOrganisation;
|
||||
|
||||
/**
|
||||
* Turns this entity into it's response class.
|
||||
*/
|
||||
public toResponse(): ResponseRunnerTeam {
|
||||
return new ResponseRunnerTeam(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user