aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/common
diff options
context:
space:
mode:
authorAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-28 15:29:33 +0200
committerAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-28 15:29:33 +0200
commit34862b8ae117126e055f3cb71b464e448d2c5827 (patch)
tree7caf9ca723f5f2b634891aa206199dd0f7b2078d /cds-ui/designer-client/src/app/common
parent83221b2423060db32826065938edeebb5680b30f (diff)
Add package deletion button
Issue-ID: CCSDK-2483 Signed-off-by: AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I7e1c0f80eb9e6073a1eb472bd6f042e8545c5ab7
Diffstat (limited to 'cds-ui/designer-client/src/app/common')
-rw-r--r--cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts15
1 files changed, 10 insertions, 5 deletions
diff --git a/cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts b/cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts
index d4851ded5..b73d48ed9 100644
--- a/cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts
+++ b/cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts
@@ -22,9 +22,9 @@ limitations under the License.
============LICENSE_END============================================
*/
-import {Injectable} from '@angular/core';
-import {HttpClient, HttpParams} from '@angular/common/http';
-import {Observable} from 'rxjs';
+import { Injectable } from '@angular/core';
+import { HttpClient, HttpParams } from '@angular/common/http';
+import { Observable } from 'rxjs';
@Injectable()
export class ApiService<T> {
@@ -40,7 +40,7 @@ export class ApiService<T> {
httpParams = httpParams.append(key, params[key]);
}
}
- const options = {params: httpParams};
+ const options = { params: httpParams };
return this.httpClient.get<T[]>(url, options);
}
@@ -49,6 +49,11 @@ export class ApiService<T> {
return this.httpClient.post(url, body, options);
}
+ delete(url: string, body: any | null): Observable<any> {
+
+ return this.httpClient.delete(url, body);
+ }
+
getOne(url: string, params?: {}): Observable<T> {
console.log('params', params);
let httpParams = new HttpParams();
@@ -57,7 +62,7 @@ export class ApiService<T> {
httpParams = httpParams.append(key, params[key]);
}
}
- const options = {params: httpParams};
+ const options = { params: httpParams };
return this.httpClient.get<T>(url, options);
}