diff --git a/src/models/actions/create/CreateTrackScan.ts b/src/models/actions/create/CreateTrackScan.ts index 62eca4c..7befe33 100644 --- a/src/models/actions/create/CreateTrackScan.ts +++ b/src/models/actions/create/CreateTrackScan.ts @@ -1,4 +1,5 @@ -import { IsInt, IsPositive } from 'class-validator'; +import { IsInt, IsOptional, IsPositive } from 'class-validator'; +import { NotAcceptableError } from 'routing-controllers'; import { getConnection } from 'typeorm'; import { RunnerCardNotFoundError } from '../../../errors/RunnerCardErrors'; import { RunnerNotFoundError } from '../../../errors/RunnerErrors'; @@ -22,10 +23,12 @@ export class CreateTrackScan { /** * The scanning station's id that created the scan. * Mainly used for logging and traceing back scans (or errors). + * You don't have to provide the station if you're authenticateing via a scanstation token (The server takes care of it for you). */ @IsInt() @IsPositive() - station: number; + @IsOptional() + station?: number; /** * Creates a new Track entity from this.