From 028a10b734f44d4aff1ddad3f32e0c787c284e17 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Thu, 19 Jul 2018 17:13:19 +0530 Subject: refactord payload creation for retrieving template refactored payload creation process for template using utility service createPayloadForRetrieve method Issue-ID: APPC-1094 Change-Id: I1901a20c07f5d577ad5962b891f277771040b85f Signed-off-by: Sandeep J --- .../template-configuration.component.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts index 37838f0..dc40704 100644 --- a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts +++ b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts @@ -38,6 +38,7 @@ import { environment } from '../../../../../environments/environment'; import { ModalComponent } from 'ng2-bs3-modal/ng2-bs3-modal'; import { NgProgress } from 'ngx-progressbar'; import { NgxSpinnerService } from 'ngx-spinner'; +import { UtilityService } from '../../../../shared/services/utilityService/utility.service'; declare var $: any @Component({ selector: 'app-golden-configuration', templateUrl: './template-configuration.component.html', styleUrls: ['./template-configuration.component.css'] }) @@ -109,7 +110,8 @@ export class GoldenConfigurationComponent implements OnInit { private router: Router, private nService: NotificationsService, private ngProgress: NgProgress, - private spinner: NgxSpinnerService) { + private spinner: NgxSpinnerService, + private utilityService: UtilityService) { this.artifactRequest.action = ''; this.artifactRequest.version = ''; this.artifactRequest.paramsContent = '{}'; @@ -292,16 +294,7 @@ export class GoldenConfigurationComponent implements OnInit { if (refObj && refObj != undefined) { let fileName = this.artifactName; - 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 - } - } - }; + let input = this.utilityService.createPayloadForRetrieve(false, this.item.action, this.vnfType, fileName); let artifactContent: any; this.ngProgress.start(); this.httpUtil.post({ -- cgit 1.2.3-korg