diff options
Diffstat (limited to 'client/src/app/+admin/friends/shared/friend.service.ts')
-rw-r--r-- | client/src/app/+admin/friends/shared/friend.service.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/+admin/friends/shared/friend.service.ts b/client/src/app/+admin/friends/shared/friend.service.ts index 79de4470e..8bc0239ab 100644 --- a/client/src/app/+admin/friends/shared/friend.service.ts +++ b/client/src/app/+admin/friends/shared/friend.service.ts | |||
@@ -6,6 +6,7 @@ import 'rxjs/add/operator/map' | |||
6 | import { ServerDataSource } from 'ng2-smart-table' | 6 | import { ServerDataSource } from 'ng2-smart-table' |
7 | 7 | ||
8 | import { AuthHttp, RestExtractor, RestDataSource, ResultList } from '../../../shared' | 8 | import { AuthHttp, RestExtractor, RestDataSource, ResultList } from '../../../shared' |
9 | import { Pod } from '../../../../../../shared' | ||
9 | 10 | ||
10 | @Injectable() | 11 | @Injectable() |
11 | export class FriendService { | 12 | export class FriendService { |
@@ -20,7 +21,7 @@ export class FriendService { | |||
20 | return new RestDataSource(this.authHttp, FriendService.BASE_FRIEND_URL) | 21 | return new RestDataSource(this.authHttp, FriendService.BASE_FRIEND_URL) |
21 | } | 22 | } |
22 | 23 | ||
23 | makeFriends (notEmptyHosts) { | 24 | makeFriends (notEmptyHosts: String[]) { |
24 | const body = { | 25 | const body = { |
25 | hosts: notEmptyHosts | 26 | hosts: notEmptyHosts |
26 | } | 27 | } |
@@ -35,4 +36,10 @@ export class FriendService { | |||
35 | .map(res => res.status) | 36 | .map(res => res.status) |
36 | .catch((res) => this.restExtractor.handleError(res)) | 37 | .catch((res) => this.restExtractor.handleError(res)) |
37 | } | 38 | } |
39 | |||
40 | removeFriend (friend: Pod) { | ||
41 | return this.authHttp.delete(FriendService.BASE_FRIEND_URL + friend.id) | ||
42 | .map(this.restExtractor.extractDataBool) | ||
43 | .catch((res) => this.restExtractor.handleError(res)) | ||
44 | } | ||
38 | } | 45 | } |