summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts')
-rw-r--r--cds-ui/designer-client/src/app/common/core/services/api.typed.service.ts12
1 files changed, 12 insertions, 0 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 2f3778c1a..9c9477f33 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
@@ -48,4 +48,16 @@ export class ApiService<T> {
return this.httpClient.post(url, body, options);
}
+
+ getOne(url: string, params?: {}): Observable<T> {
+ console.log('params', params);
+ let httpParams = new HttpParams();
+ for (const key in params) {
+ if (params.hasOwnProperty(key)) {
+ httpParams = httpParams.append(key, params[key]);
+ }
+ }
+ const options = {params: httpParams};
+ return this.httpClient.get<T>(url, options);
+ }
}