diff options
author | KrupaNagabhushan <krupa.nagabhushan@est.tech> | 2021-07-14 14:21:47 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2021-07-21 14:13:29 +0000 |
commit | 0514ec6635a08cdbaac5d664c3a4f13bcb0cbf51 (patch) | |
tree | 8ece729ff236e5011b705c3c79536eb482a44a7c /catalog-ui/src/app/ng2/services | |
parent | a3da4a7625f75f719a0ef1ffe1c2bef87828d2f3 (diff) |
Consider component model when retrieving relationship types
Issue-ID: SDC-3640
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Change-Id: Ic06a9085b8aa2f44b8d33d7de12eadf691106131
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r-- | catalog-ui/src/app/ng2/services/tosca-types.service.ts | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/catalog-ui/src/app/ng2/services/tosca-types.service.ts b/catalog-ui/src/app/ng2/services/tosca-types.service.ts index 83b833b1ab..2fc2e7a089 100644 --- a/catalog-ui/src/app/ng2/services/tosca-types.service.ts +++ b/catalog-ui/src/app/ng2/services/tosca-types.service.ts @@ -14,18 +14,18 @@ * permissions and limitations under the License. */ -import { HttpClient } from '@angular/common/http'; -import { Inject, Injectable } from '@angular/core'; -import { Response } from '@angular/http'; +import {HttpClient} from '@angular/common/http'; +import {Inject, Injectable} from '@angular/core'; +import {Response} from '@angular/http'; import { - CapabilityTypeModel, - CapabilityTypesMap, - IComponentsArray, - NodeTypesMap, - RelationshipTypesMap + CapabilityTypeModel, + CapabilityTypesMap, + IComponentsArray, + NodeTypesMap, + RelationshipTypesMap } from 'app/models'; -import { Observable } from 'rxjs/Observable'; -import { ISdcConfig, SdcConfigToken } from '../config/sdc-config.config'; +import {Observable} from 'rxjs/Observable'; +import {ISdcConfig, SdcConfigToken} from '../config/sdc-config.config'; import 'rxjs/add/operator/toPromise'; declare var angular: angular.IAngularStatic; @@ -33,22 +33,22 @@ declare var angular: angular.IAngularStatic; @Injectable() export class ToscaTypesServiceNg2 { - protected baseUrl; + protected baseUrl; - constructor(protected http: HttpClient, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) { - this.baseUrl = sdcConfig.api.root + sdcConfig.api.component_api_root; - } + constructor(protected http: HttpClient, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) { + this.baseUrl = sdcConfig.api.root + sdcConfig.api.component_api_root; + } - async fetchRelationshipTypes(): Promise<RelationshipTypesMap> { - return this.http.get<RelationshipTypesMap>(this.baseUrl + 'relationshipTypes').toPromise(); - } + async fetchRelationshipTypes(modelName: string): Promise<RelationshipTypesMap> { + return this.http.get<RelationshipTypesMap>(this.baseUrl + 'relationshipTypes', {params: {model: modelName}}).toPromise(); + } - async fetchNodeTypes(): Promise<NodeTypesMap> { - return this.http.get<NodeTypesMap>(this.baseUrl + 'nodeTypes').toPromise(); - } + async fetchNodeTypes(): Promise<NodeTypesMap> { + return this.http.get<NodeTypesMap>(this.baseUrl + 'nodeTypes').toPromise(); + } - async fetchCapabilityTypes(): Promise<CapabilityTypesMap>{ - return this.http.get<CapabilityTypesMap>(this.baseUrl + 'capabilityTypes').toPromise(); - } + async fetchCapabilityTypes(): Promise<CapabilityTypesMap> { + return this.http.get<CapabilityTypesMap>(this.baseUrl + 'capabilityTypes').toPromise(); + } } |