All things deletion for runner* now are clean af and cascadeing

ref #13
This commit is contained in:
2020-12-05 12:15:51 +01:00
parent 9c63a34fe1
commit 45675b0699
6 changed files with 33 additions and 70 deletions

View File

@@ -1,6 +1,5 @@
import { IsNotEmpty } from "class-validator";
import { ChildEntity, getConnectionManager, ManyToOne } from "typeorm";
import { Runner } from './Runner';
import { ChildEntity, ManyToOne } from "typeorm";
import { RunnerGroup } from "./RunnerGroup";
import { RunnerOrganisation } from "./RunnerOrganisation";
@@ -17,11 +16,4 @@ export class RunnerTeam extends RunnerGroup {
@IsNotEmpty()
@ManyToOne(() => RunnerOrganisation, org => org.teams, { nullable: true })
parentGroup?: RunnerOrganisation;
/**
* Returns all runners associated with this team.
*/
public async getRunners() {
return await getConnectionManager().get().getRepository(Runner).find({ group: this });
}
}