diff --git a/src/models/actions/CreateParticipant.ts b/src/models/actions/CreateParticipant.ts index 1bc45ac..808d3c2 100644 --- a/src/models/actions/CreateParticipant.ts +++ b/src/models/actions/CreateParticipant.ts @@ -47,7 +47,7 @@ export abstract class CreateParticipant { /** * The new participant's address. - * Must be of type number (address id), createAddress (new address) or address (existing address) + * Must be of type number (address id). * Optional. */ @IsInt() diff --git a/src/models/actions/CreateRunner.ts b/src/models/actions/CreateRunner.ts index f3611ce..2b9f128 100644 --- a/src/models/actions/CreateRunner.ts +++ b/src/models/actions/CreateRunner.ts @@ -10,8 +10,7 @@ import { CreateParticipant } from './CreateParticipant'; export class CreateRunner extends CreateParticipant { /** - * The new runner's team's id. - * Either provide this or his organisation's id. + * The new runner's group's id. */ @IsInt() group: number; diff --git a/src/models/actions/CreateRunnerGroup.ts b/src/models/actions/CreateRunnerGroup.ts index 76552ac..288baeb 100644 --- a/src/models/actions/CreateRunnerGroup.ts +++ b/src/models/actions/CreateRunnerGroup.ts @@ -20,16 +20,16 @@ export abstract class CreateRunnerGroup { contact?: number; /** - * Deals with the contact for groups this. + * Get's this group's contact from this.address. */ public async getContact(): Promise { if (this.contact === undefined) { return null; } if (!isNaN(this.contact)) { - let address = await getConnectionManager().get().getRepository(GroupContact).findOne({ id: this.contact }); - if (!address) { throw new GroupContactNotFoundError; } - return address; + let contact = await getConnectionManager().get().getRepository(GroupContact).findOne({ id: this.contact }); + if (!contact) { throw new GroupContactNotFoundError; } + return contact; } throw new GroupContactWrongTypeError; diff --git a/src/models/actions/CreateRunnerOrganisation.ts b/src/models/actions/CreateRunnerOrganisation.ts index 01c3732..46fc72e 100644 --- a/src/models/actions/CreateRunnerOrganisation.ts +++ b/src/models/actions/CreateRunnerOrganisation.ts @@ -8,7 +8,7 @@ import { CreateRunnerGroup } from './CreateRunnerGroup'; export class CreateRunnerOrganisation extends CreateRunnerGroup { /** * The new organisation's address. - * Must be of type number (address id), createAddress (new address) or address (existing address) + * Must be of type number (address id). * Optional. */ @IsInt() @@ -16,7 +16,7 @@ export class CreateRunnerOrganisation extends CreateRunnerGroup { address?: number; /** - * Creates a Participant entity from this. + * Get's this org's address from this.address. */ public async getAddress(): Promise
{ if (this.address === undefined) { diff --git a/src/models/actions/CreateTrack.ts b/src/models/actions/CreateTrack.ts index 42bf384..9994094 100644 --- a/src/models/actions/CreateTrack.ts +++ b/src/models/actions/CreateTrack.ts @@ -10,7 +10,7 @@ export class CreateTrack { name: string; /** - * The track's distance in meters (must be greater 0). + * The track's distance in meters (must be greater than 0). */ @IsInt() @IsPositive() diff --git a/src/models/actions/UpdateRunner.ts b/src/models/actions/UpdateRunner.ts index 436b947..5ade74f 100644 --- a/src/models/actions/UpdateRunner.ts +++ b/src/models/actions/UpdateRunner.ts @@ -10,15 +10,13 @@ import { CreateParticipant } from './CreateParticipant'; export class UpdateRunner extends CreateParticipant { /** - * The new runner's team's id. - * Either provide this or his organisation's id. + * The updated runner's id. */ @IsInt() id: number; /** - * The new runner's team's id. - * Either provide this or his organisation's id. + * The updated runner's new team/org. */ @IsObject() group: RunnerGroup;