aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/friends/friend.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/friends/friend.service.ts')
-rw-r--r--client/src/app/friends/friend.service.ts12
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 @@
1import { Injectable } from '@angular/core'; 1import { Injectable } from '@angular/core';
2import { Http, Response } from '@angular/http'; 2import { Response } from '@angular/http';
3import { Observable } from 'rxjs/Observable'; 3import { Observable } from 'rxjs/Observable';
4 4
5import { AuthService } from '../shared'; 5import { AuthHttp, AuthService } from '../shared';
6 6
7@Injectable() 7@Injectable()
8export class FriendService { 8export 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 }