refactor(RunnerTeamController.remove): only load necessary relations
This commit is contained in:
parent
4008a5ee72
commit
c0d5af5d7a
@ -119,7 +119,7 @@ export class RunnerTeamController {
|
||||
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
||||
let team = await this.runnerTeamRepository.findOne({ id: id });
|
||||
if (!team) { return null; }
|
||||
let runnerTeam = await this.runnerTeamRepository.findOne(team, { relations: ['parentGroup', 'contact', 'runners'] });
|
||||
let runnerTeam = await this.runnerTeamRepository.findOne(team, { relations: ['runners'] });
|
||||
|
||||
if (!force) {
|
||||
if (runnerTeam.runners.length != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user