Added card creation

#17
This commit is contained in:
niggl committed 2021-01-09 11:48:13 +01:00
1 parent a5bfe4e3d5
commit 36ecae7e6e
4 files changed
+72 -29

No files matched your search

+3 -2
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;
}