From 5ede965c0c3dd365be4efde0699d5ec976a614c3 Mon Sep 17 00:00:00 2001 From: Ezhilarasi Date: Mon, 29 Jul 2019 20:07:04 +0530 Subject: Blueprint client backend integration fix Blueprint backend data integration fix Change-Id: If0e0b2c30bf07f06fc728ff26c509f265c5ee303 Issue-ID: CCSDK-1275 Signed-off-by: Ezhilarasi --- .../modify-template/editor/editor.service.ts | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts') diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts index ec2524422..025fc95d4 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts +++ b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts @@ -25,19 +25,18 @@ import { HttpClient } from '@angular/common/http'; import { Observable, observable } from 'rxjs'; import { ApiService } from '../../../../common/core/services/api.service'; import { saveAs } from 'file-saver'; +import { BlueprintURLs } from '../../../../common/constants/app-constants'; @Injectable() export class EditorService { - // blueprintUrl = '../../constants/blueprint.json'; - constructor(private _http: HttpClient, private api: ApiService) { } - enrich(uri: string, body: FormData): Observable { - return this.api.post(uri, body, { responseType: 'blob' }); + enrich(body: FormData): Observable { + return this.api.post(BlueprintURLs.enrich, body, { responseType: 'blob' }); } - downloadCBA(uri: string): string { - this.api.get(uri, { responseType: 'blob' }) + downloadCBA(artifactDetails: string): string { + this.api.get(BlueprintURLs.download+artifactDetails, { responseType: 'blob' }) .subscribe(response => { let blob = new Blob([response], { 'type': "application/octet-stream" }); saveAs(blob, "CBA.zip"); @@ -46,13 +45,17 @@ export class EditorService { return "Download Success"; } - post(uri: string, body: any | null, options?: any): Observable { + saveBlueprint(body: any | null, options?: any): Observable { + + return this.api.post(BlueprintURLs.save, body, options); + } + publishBlueprint(body: any | null, options?: any): Observable { - return this.api.post(uri, body, options); + return this.api.post(BlueprintURLs.publish, body, options); } - deployPost(uri: string, body: any | null, options?: any): Observable { + deployPost(body: any | null, options?: any): Observable { - return this.api.post(uri, body, { responseType: 'text' }); + return this.api.post(BlueprintURLs.deploy, body, { responseType: 'text' }); } } \ No newline at end of file -- cgit 1.2.3-korg