]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | import { HttpClient, HttpParams } from '@angular/common/http'; |
2 | import { Injectable } from '@angular/core'; | |
3 | ||
4 | import { cdEncode } from '../decorators/cd-encode'; | |
5 | import { ApiModule } from './api.module'; | |
6 | ||
7 | @cdEncode | |
8 | @Injectable({ | |
9 | providedIn: ApiModule | |
10 | }) | |
11 | export class RgwSiteService { | |
12 | private url = 'api/rgw/site'; | |
13 | ||
14 | constructor(private http: HttpClient) {} | |
15 | ||
e306af50 | 16 | get(query?: string) { |
9f95a23c | 17 | let params = new HttpParams(); |
e306af50 TL |
18 | if (query) { |
19 | params = params.append('query', query); | |
20 | } | |
9f95a23c TL |
21 | |
22 | return this.http.get(this.url, { params: params }); | |
23 | } | |
24 | } |