diff --git a/src/models/actions/update/UpdateRunner.ts b/src/models/actions/update/UpdateRunner.ts index d2ba31a..e9e323b 100644 --- a/src/models/actions/update/UpdateRunner.ts +++ b/src/models/actions/update/UpdateRunner.ts @@ -1,7 +1,6 @@ import { IsInt, IsPositive } from 'class-validator'; import { getConnectionManager } from 'typeorm'; import { RunnerGroupNotFoundError } from '../../../errors/RunnerGroupErrors'; -import { RunnerOrganisationWrongTypeError } from '../../../errors/RunnerOrganisationErrors'; import { RunnerTeamNeedsParentError } from '../../../errors/RunnerTeamErrors'; import { Runner } from '../../entities/Runner'; import { RunnerGroup } from '../../entities/RunnerGroup'; @@ -48,12 +47,8 @@ export class UpdateRunner extends CreateParticipant { if (this.group === undefined || this.group === null) { throw new RunnerTeamNeedsParentError(); } - if (!isNaN(this.group.id)) { - let group = await getConnectionManager().get().getRepository(RunnerGroup).findOne({ id: this.group.id }); - if (!group) { throw new RunnerGroupNotFoundError; } - return group; - } - - throw new RunnerOrganisationWrongTypeError; + let group = await getConnectionManager().get().getRepository(RunnerGroup).findOne({ id: this.group }); + if (!group) { throw new RunnerGroupNotFoundError; } + return group; } } \ No newline at end of file