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