}
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();
}
}
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")
}
}
}
+ 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;
+ }
+
}