Fixed Creation of normal scans

ref #67
This commit is contained in:
2021-01-07 16:32:16 +01:00
parent a2c3913601
commit 30502ec949
4 changed files with 62 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { IsBoolean, IsInt, IsNotEmpty, IsPositive } from "class-validator";
import { IsBoolean, IsInt, IsPositive } from "class-validator";
import { Scan } from '../entities/Scan';
import { ResponseRunner } from './ResponseRunner';
@@ -16,8 +16,8 @@ export class ResponseScan {
* The scan's associated runner.
* This is important to link ran distances to runners.
*/
@IsNotEmpty()
runner: ResponseRunner;
// @IsNotEmpty()
runner?: ResponseRunner;
/**
* Is the scan valid (for fraud reasons).
@@ -39,7 +39,7 @@ export class ResponseScan {
*/
public constructor(scan: Scan) {
this.id = scan.id;
this.runner = new ResponseRunner(scan.runner);
this.runner = null;
this.distance = scan.distance;
this.valid = scan.valid;
}