diff options
-rw-r--r-- | src/app/test/test.component.ts | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/src/app/test/test.component.ts b/src/app/test/test.component.ts index 3797c8c..7560e7b 100644 --- a/src/app/test/test.component.ts +++ b/src/app/test/test.component.ts @@ -215,21 +215,7 @@ export class TestComponent implements OnInit { } else { this.nService.error('Error', 'Incorrect spreadsheet uploaded'); - this.flag = 1; - this.oldListName1 = ''; - this.vmJson = {}; - this.vnfcJson = {}; - this.subPayload = {}; - this.vmPayload = []; - this.payload = {}; - this.action = ''; - this.actionIdentifiers = {}; - this.apiRequest = ''; - this.apiResponse = ''; - this.enableCounterDiv = false; - this.enableAbort = false; - this.enableTestButton = false; - this.enableDownload = false; + this.setValuesOnFileUploadFailure(); } } @@ -282,21 +268,7 @@ export class TestComponent implements OnInit { this.nService.success('Success', 'SpreadSheet uploaded successfully'); } else { - this.flag = 1; - this.oldListName1 = ''; - this.vmJson = {}; - this.vnfcJson = {}; - this.subPayload = {}; - this.vmPayload = []; - this.payload = {}; - this.action = ''; - this.actionIdentifiers = {}; - this.apiRequest = ''; - this.apiResponse = ''; - this.enableCounterDiv = false; - this.enableAbort = false; - this.enableTestButton = false; - this.enableDownload = false; + this.setValuesOnFileUploadFailure(); this.nService.error("Error", "Please check the contents of the file uploaded") } } @@ -520,4 +492,22 @@ export class TestComponent implements OnInit { } + setValuesOnFileUploadFailure() { + this.flag = 1; + this.oldListName1 = ''; + this.vmJson = {}; + this.vnfcJson = {}; + this.subPayload = {}; + this.vmPayload = []; + this.payload = {}; + this.action = ''; + this.actionIdentifiers = {}; + this.apiRequest = ''; + this.apiResponse = ''; + this.enableCounterDiv = false; + this.enableAbort = false; + this.enableTestButton = false; + this.enableDownload = false; + } + } |