From 70fc95f0db2ed052cbb6067583cc890646753c9e Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Fri, 20 Jul 2018 13:28:33 +0530 Subject: refactored payload creation proces in retrieve API refactored payload creation in retrieveNameValueFromAppc method of param-name-value.component.ts by using the createPayloadForRetrieve method in utility.service.ts Issue-ID: APPC-1098 Change-Id: Ia5b4a7c259c9a27958b6df9c59869a79b03064ee Signed-off-by: Sandeep J --- .../param-name-value/param-name-value.component.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/app/vnfs/build-artifacts/template-holder/param-name-value') diff --git a/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts b/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts index bdf0b29..40a5291 100644 --- a/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts +++ b/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts @@ -43,6 +43,7 @@ import { environment } from '../../../../../environments/environment'; import { NgProgress } from 'ngx-progressbar'; import * as XLSX from 'xlsx'; import { NgxSpinnerService } from 'ngx-spinner'; +import {UtilityService} from '../../../../shared/services/utilityService/utility.service'; declare var $: any; @@ -120,7 +121,8 @@ export class GoldenConfigurationMappingComponent implements OnInit, OnDestroy { private notificationService: NotificationService, private nService: NotificationsService, private ngProgress: NgProgress, - private spinner: NgxSpinnerService + private spinner: NgxSpinnerService, + private utilityService: UtilityService, ) { this.artifactRequest.action = ''; this.artifactRequest.version = ''; @@ -319,18 +321,7 @@ export class GoldenConfigurationMappingComponent implements OnInit, OnDestroy { if (id) fileName = this.updateFileNameForConfigScaleOut(this.item.action, scopeName, this.versionNo, id); else fileName = this.updateFileName(this.item.action, scopeName, this.versionNo); - let payload = '{"userID": "' + this.userId + '", "action": "' + this.item.action + '", "vnf-type" : "' + this.vnfType + '", "artifact-type":"APPC-CONFIG", "artifact-name":"' + fileName + '"}'; - let input = { - 'input': { - 'design-request': { - 'request-id': this.apiToken, - 'action': 'getArtifact', - 'payload': payload - } - } - }; - - console.log('Retrieve name value from appc payload===>>' + payload); + let input=this.utilityService.createPayloadForRetrieve(false, this.item.action, this.vnfType, fileName); let artifactContent: any; this.ngProgress.start(); this.nameValueSubscription = this.httpUtil.post({ -- cgit 1.2.3-korg