diff options
Diffstat (limited to 'client/src/app/friends')
-rw-r--r-- | client/src/app/friends/friend.service.ts | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/client/src/app/friends/friend.service.ts b/client/src/app/friends/friend.service.ts index f956a5ece..771046484 100644 --- a/client/src/app/friends/friend.service.ts +++ b/client/src/app/friends/friend.service.ts | |||
@@ -1,25 +1,23 @@ | |||
1 | import { Injectable } from '@angular/core'; | 1 | import { Injectable } from '@angular/core'; |
2 | import { Http, Response } from '@angular/http'; | 2 | import { Response } from '@angular/http'; |
3 | import { Observable } from 'rxjs/Observable'; | 3 | import { Observable } from 'rxjs/Observable'; |
4 | 4 | ||
5 | import { AuthService } from '../shared'; | 5 | import { AuthHttp, AuthService } from '../shared'; |
6 | 6 | ||
7 | @Injectable() | 7 | @Injectable() |
8 | export class FriendService { | 8 | export class FriendService { |
9 | private static BASE_FRIEND_URL: string = '/api/v1/pods/'; | 9 | private static BASE_FRIEND_URL: string = '/api/v1/pods/'; |
10 | 10 | ||
11 | constructor (private http: Http, private authService: AuthService) {} | 11 | constructor (private authHttp: AuthHttp, private authService: AuthService) {} |
12 | 12 | ||
13 | makeFriends() { | 13 | makeFriends() { |
14 | const headers = this.authService.getRequestHeader(); | 14 | return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'makefriends') |
15 | return this.http.get(FriendService.BASE_FRIEND_URL + 'makefriends', { headers }) | ||
16 | .map(res => res.status) | 15 | .map(res => res.status) |
17 | .catch(this.handleError); | 16 | .catch(this.handleError); |
18 | } | 17 | } |
19 | 18 | ||
20 | quitFriends() { | 19 | quitFriends() { |
21 | const headers = this.authService.getRequestHeader(); | 20 | return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'quitfriends') |
22 | return this.http.get(FriendService.BASE_FRIEND_URL + 'quitfriends', { headers }) | ||
23 | .map(res => res.status) | 21 | .map(res => res.status) |
24 | .catch(this.handleError); | 22 | .catch(this.handleError); |
25 | } | 23 | } |