aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/friends/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/friends/shared')
-rw-r--r--client/src/app/+admin/friends/shared/friend.service.ts15
1 files changed, 11 insertions, 4 deletions
diff --git a/client/src/app/+admin/friends/shared/friend.service.ts b/client/src/app/+admin/friends/shared/friend.service.ts
index 274373e3b..a32cdcc88 100644
--- a/client/src/app/+admin/friends/shared/friend.service.ts
+++ b/client/src/app/+admin/friends/shared/friend.service.ts
@@ -1,9 +1,12 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient, HttpParams } from '@angular/common/http'
3import { Observable } from 'rxjs/Observable'
3import 'rxjs/add/operator/catch' 4import 'rxjs/add/operator/catch'
4import 'rxjs/add/operator/map' 5import 'rxjs/add/operator/map'
5 6
6import { RestExtractor } from '../../../shared' 7import { SortMeta } from 'primeng/primeng'
8
9import { RestExtractor, RestPagination, RestService } from '../../../shared'
7import { Pod, ResultList } from '../../../../../../shared' 10import { Pod, ResultList } from '../../../../../../shared'
8 11
9@Injectable() 12@Injectable()
@@ -12,11 +15,15 @@ export class FriendService {
12 15
13 constructor ( 16 constructor (
14 private authHttp: HttpClient, 17 private authHttp: HttpClient,
18 private restService: RestService,
15 private restExtractor: RestExtractor 19 private restExtractor: RestExtractor
16 ) {} 20 ) {}
17 21
18 getFriends () { 22 getFriends (pagination: RestPagination, sort: SortMeta): Observable<ResultList<Pod>> {
19 return this.authHttp.get<ResultList<Pod>>(FriendService.BASE_FRIEND_URL) 23 let params = new HttpParams()
24 params = this.restService.addRestGetParams(params, pagination, sort)
25
26 return this.authHttp.get<ResultList<Pod>>(FriendService.BASE_FRIEND_URL, { params })
20 .map(res => this.restExtractor.convertResultListDateToHuman(res)) 27 .map(res => this.restExtractor.convertResultListDateToHuman(res))
21 .catch(res => this.restExtractor.handleError(res)) 28 .catch(res => this.restExtractor.handleError(res))
22 } 29 }