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) {
|
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
||||||
let team = await this.runnerTeamRepository.findOne({ id: id });
|
let team = await this.runnerTeamRepository.findOne({ id: id });
|
||||||
if (!team) { return null; }
|
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 (!force) {
|
||||||
if (runnerTeam.runners.length != 0) {
|
if (runnerTeam.runners.length != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user