Added card creation

#17
This commit is contained in:
2021-01-09 11:48:13 +01:00
parent a5bfe4e3d5
commit 36ecae7e6e
4 changed files with 72 additions and 29 deletions

View File

@@ -17,7 +17,7 @@ export class ResponseRunnerCard {
* This is important to link scans to runners.
*/
@IsObject()
runner: ResponseRunner;
runner: ResponseRunner | null;
/**
* The card's code.
@@ -40,7 +40,8 @@ export class ResponseRunnerCard {
*/
public constructor(card: RunnerCard) {
this.id = card.id;
this.runner = card.runner.toResponse() || null;
if (!card.runner) { this.runner = null }
else { this.runner = card.runner.toResponse(); }
this.code = card.code;
this.enabled = card.enabled;
}