diff options
Diffstat (limited to 'client/app/friends/friend.service.ts')
-rw-r--r-- | client/app/friends/friend.service.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/app/friends/friend.service.ts b/client/app/friends/friend.service.ts index d143ec40d..bdfa7baec 100644 --- a/client/app/friends/friend.service.ts +++ b/client/app/friends/friend.service.ts | |||
@@ -4,23 +4,23 @@ import { Observable } from 'rxjs/Rx'; | |||
4 | 4 | ||
5 | @Injectable() | 5 | @Injectable() |
6 | export class FriendService { | 6 | export class FriendService { |
7 | private _baseFriendsUrl = '/api/v1/pods/'; | 7 | private static BASE_FRIEND_URL: string = '/api/v1/pods/'; |
8 | 8 | ||
9 | constructor (private http: Http) {} | 9 | constructor (private http: Http) {} |
10 | 10 | ||
11 | makeFriends() { | 11 | makeFriends() { |
12 | return this.http.get(this._baseFriendsUrl + 'makefriends') | 12 | return this.http.get(FriendService.BASE_FRIEND_URL + 'makefriends') |
13 | .map(res => <number> res.status) | 13 | .map(res => res.status) |
14 | .catch(this.handleError); | 14 | .catch(this.handleError); |
15 | } | 15 | } |
16 | 16 | ||
17 | quitFriends() { | 17 | quitFriends() { |
18 | return this.http.get(this._baseFriendsUrl + 'quitfriends') | 18 | return this.http.get(FriendService.BASE_FRIEND_URL + 'quitfriends') |
19 | .map(res => <number> res.status) | 19 | .map(res => res.status) |
20 | .catch(this.handleError); | 20 | .catch(this.handleError); |
21 | } | 21 | } |
22 | 22 | ||
23 | private handleError (error: Response) { | 23 | private handleError (error: Response): Observable<number> { |
24 | console.error(error); | 24 | console.error(error); |
25 | return Observable.throw(error.json().error || 'Server error'); | 25 | return Observable.throw(error.json().error || 'Server error'); |
26 | } | 26 | } |