X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fpolicy%2Fpolicy.service.ts;h=93f08e7168b16c8a54f519cd43574a88f7c78eaa;hb=5372422520d7cfb5760a536cce0da7b15f012eda;hp=c5ee5798ac24a288a3d82b3775536f4cf7254fcb;hpb=f507d92d55ee77fad16cc024ea95c869e0d5dc32;p=portal%2Fnonrtric-controlpanel.git diff --git a/webapp-frontend/src/app/services/policy/policy.service.ts b/webapp-frontend/src/app/services/policy/policy.service.ts index c5ee579..93f08e7 100644 --- a/webapp-frontend/src/app/services/policy/policy.service.ts +++ b/webapp-frontend/src/app/services/policy/policy.service.ts @@ -67,7 +67,7 @@ export class PolicyService { } getPolicyInstances(policyTypeId: string): Observable { - const url = this.buildPath(this.policyTypePath, policyTypeId, this.policyPath); + const url = this.buildPath(this.policyPath) + '?type=' + policyTypeId; return this.httpClient.get(url); } @@ -76,7 +76,7 @@ export class PolicyService { * @returns Observable that should yield a policy instance */ getPolicy(policyTypeId: string, policyInstanceId: string): Observable { - const url = this.buildPath(this.policyTypePath, policyTypeId, this.policyPath, policyInstanceId); + const url = this.buildPath(this.policyPath, policyInstanceId) + '?type=' + policyTypeId; return this.httpClient.get(url); } @@ -88,17 +88,18 @@ export class PolicyService { * @returns Observable that should yield a response code, no data */ putPolicy(policyTypeId: string, policyInstanceId: string, policyJson: string, ric: string): Observable { - const url = this.buildPath(this.policyTypePath, policyTypeId, this.policyPath, policyInstanceId) + "?ric=" + ric; + const url = this.buildPath(this.policyPath, policyInstanceId) + '?ric=' + ric + '&type=' + policyTypeId; return this.httpClient.put(url, policyJson, { observe: 'response' }); } /** * Deletes a policy instance. - * @param policyTypeId + * @param policyTypeId ID of the policy type that the instance belong to + * @param policyInstanceId ID of the instance * @returns Observable that should yield a response code, no data */ deletePolicy(policyTypeId: string, policyInstanceId: string): Observable { - const url = this.buildPath(this.policyTypePath, policyTypeId, this.policyPath, policyInstanceId); + const url = this.buildPath(this.policyPath, policyInstanceId) + '?type=' + policyTypeId; return this.httpClient.delete(url, { observe: 'response' }); }