]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/friends/friend.service.ts
Client: implement password change
[github/Chocobozzz/PeerTube.git] / client / src / app / friends / friend.service.ts
index a8b1a1bd3527d8d6a544e9b4391cfa21a6990136..7710464846633a0448d7586594b49c0c54062c7e 100644 (file)
@@ -1,25 +1,23 @@
 import { Injectable } from '@angular/core';
-import { Http, Response } from '@angular/http';
-import { Observable } from 'rxjs/Rx';
+import { Response } from '@angular/http';
+import { Observable } from 'rxjs/Observable';
 
-import { AuthService } from '../shared';
+import { AuthHttp, AuthService } from '../shared';
 
 @Injectable()
 export class FriendService {
   private static BASE_FRIEND_URL: string = '/api/v1/pods/';
 
-  constructor (private http: Http, private authService: AuthService) {}
+  constructor (private authHttp: AuthHttp, private authService: AuthService) {}
 
   makeFriends() {
-    const headers = this.authService.getRequestHeader();
-    return this.http.get(FriendService.BASE_FRIEND_URL + 'makefriends', { headers })
+    return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'makefriends')
                     .map(res => res.status)
                     .catch(this.handleError);
   }
 
   quitFriends() {
-    const headers = this.authService.getRequestHeader();
-    return this.http.get(FriendService.BASE_FRIEND_URL + 'quitfriends', { headers })
+    return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'quitfriends')
                     .map(res => res.status)
                     .catch(this.handleError);
   }