diff options
author | Sandeep J <sandeejh@in.ibm.com> | 2018-07-19 17:13:19 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-19 21:02:20 +0000 |
commit | 028a10b734f44d4aff1ddad3f32e0c787c284e17 (patch) | |
tree | 1dc46d77af4fa890dd0e74a63f2983e6d866a35f | |
parent | 6e90b44532646e1abae58647d9bfbd95ddfd585a (diff) |
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 <sandeejh@in.ibm.com>
-rw-r--r-- | src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts | 15 |
1 files 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({ |