1 import { Injectable } from '@angular/core';
2 import { Response } from '@angular/http';
3 import { Observable } from 'rxjs/Observable';
5 import { AuthHttp, AuthService } from '../shared';
8 export class FriendService {
9 private static BASE_FRIEND_URL: string = '/api/v1/pods/';
11 constructor (private authHttp: AuthHttp, private authService: AuthService) {}
14 return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'makefriends')
15 .map(res => res.status)
16 .catch(this.handleError);
20 return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'quitfriends')
21 .map(res => res.status)
22 .catch(this.handleError);
25 private handleError (error: Response): Observable<number> {
27 return Observable.throw(error.json().error || 'Server error');