aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-07-20 14:39:04 +0530
committerTakamune Cho <tc012c@att.com>2018-07-31 20:38:20 +0000
commit9095da958110edbe88704ee39648d48277f1b9f4 (patch)
treeff479473d7e5edfbb33632e7396515ec81312486 /src
parent77ebde8e73fa4f1cdeeeff2c5d3f044b900bf329 (diff)
refactored payload in uploadArtifact of reference
refactored payload in uploadArtifact method of reference dataform using createPayloadForSave method of utlity service Issue-ID: APPC-1100 Change-Id: I9f91725371da96e6d2384b2348e288ebc0af238d Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts
index 65876e0..11013b7 100644
--- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts
+++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts
@@ -39,7 +39,7 @@ import { saveAs } from 'file-saver';
import { UtilityService } from '../../../shared/services/utilityService/utility.service';
declare var $: any;
type AOA = Array<Array<any>>;
-
+const REFERENCE_DATA:string= "reference_data";
@Component({
selector: 'reference-dataform',
templateUrl: './reference-dataform.component.html',
@@ -648,16 +648,7 @@ export class ReferenceDataformComponent implements OnInit {
uploadArtifact(artifactData, dataJson, fileName) {
let data = [];
let slashedPayload = this.appendSlashes(artifactData);
- let newPyaload = '{"userID": "' + localStorage['userId'] + '","vnf-type" : "' + dataJson['scope']['vnf-type'] + '","action" : "AllAction","artifact-name" : "' + fileName + '","artifact-type" : "APPC-CONFIG","artifact-version" : "0.1","artifact-contents" :" ' + slashedPayload + '"}';
- let payload = {
- 'input': {
- 'design-request': {
- 'request-id': localStorage['apiToken'],
- 'action': 'uploadArtifact',
- 'payload': newPyaload,
- }
- }
- };
+ let payload = this.utilityService.createPayLoadForSave(REFERENCE_DATA, dataJson['scope']['vnf-type'], "AllAction", fileName, this.versionNoForApiCall, slashedPayload);
this.ngProgress.start();
this.httpUtils.post({
url: environment.getDesigns,