From e96637219ff01d5da2feeb933538748fca440cbd Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Fri, 15 Jan 2021 18:29:30 +0100 Subject: [PATCH] Refactoring: switched update runner group from objects to ids ref #90 --- src/models/actions/update/UpdateRunner.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/models/actions/update/UpdateRunner.ts b/src/models/actions/update/UpdateRunner.ts index 29a2423..d2ba31a 100644 --- a/src/models/actions/update/UpdateRunner.ts +++ b/src/models/actions/update/UpdateRunner.ts @@ -1,4 +1,4 @@ -import { IsInt, IsObject } from 'class-validator'; +import { IsInt, IsPositive } from 'class-validator'; import { getConnectionManager } from 'typeorm'; import { RunnerGroupNotFoundError } from '../../../errors/RunnerGroupErrors'; import { RunnerOrganisationWrongTypeError } from '../../../errors/RunnerOrganisationErrors'; @@ -20,11 +20,11 @@ export class UpdateRunner extends CreateParticipant { id: number; /** - * The updated runner's new team/org. - * Just has to contain the group's id -everything else won't be checked or changed. + * The updated runner's group's id. */ - @IsObject() - group: RunnerGroup; + @IsInt() + @IsPositive() + group: number; /** * Updates a provided Runner entity based on this.