diff options
author | 2019-07-29 14:59:23 +0000 | |
---|---|---|
committer | 2019-07-29 14:59:23 +0000 | |
commit | a19b41ed344b70860cdb9694d6bd918890545ee4 (patch) | |
tree | 8ddd14585e5b8e54d5c732f58fffa6c0804f53bd /cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts | |
parent | c3295a523d1ded477501b8efa9e56458f6eb3dc6 (diff) | |
parent | 5ede965c0c3dd365be4efde0699d5ec976a614c3 (diff) |
Merge "Blueprint client backend integration fix"
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts')
-rw-r--r-- | cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts | 23 |
1 files changed, 13 insertions, 10 deletions
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<any> { - return this.api.post(uri, body, { responseType: 'blob' }); + enrich(body: FormData): Observable<any> { + 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<any> { + saveBlueprint(body: any | null, options?: any): Observable<any> { + + return this.api.post(BlueprintURLs.save, body, options); + } + publishBlueprint(body: any | null, options?: any): Observable<any> { - return this.api.post(uri, body, options); + return this.api.post(BlueprintURLs.publish, body, options); } - deployPost(uri: string, body: any | null, options?: any): Observable<any> { + deployPost(body: any | null, options?: any): Observable<any> { - return this.api.post(uri, body, { responseType: 'text' }); + return this.api.post(BlueprintURLs.deploy, body, { responseType: 'text' }); } }
\ No newline at end of file |