@@ -1,4 +1,5 @@
|
||||
import { IsInt, IsOptional, IsString } from "class-validator";
|
||||
import { TrackLapTimeCantBeNegativeError } from '../../errors/TrackErrors';
|
||||
import { Track } from '../entities/Track';
|
||||
|
||||
/**
|
||||
@@ -40,5 +41,8 @@ export class ResponseTrack {
|
||||
this.name = track.name;
|
||||
this.distance = track.distance;
|
||||
this.minimumLapTime = track.minimumLapTime;
|
||||
if (this.minimumLapTime < 0) {
|
||||
throw new TrackLapTimeCantBeNegativeError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user