1 import { Injectable } from '@angular/core';
2 import 'rxjs/add/operator/catch';
3 import 'rxjs/add/operator/map';
5 import { AuthService } from '../core';
6 import { AuthHttp, RestExtractor } from '../shared';
9 export class AccountService {
10 private static BASE_USERS_URL = '/api/v1/users/';
13 private authHttp: AuthHttp,
14 private authService: AuthService,
15 private restExtractor: RestExtractor
18 changePassword(newPassword: string) {
19 const url = AccountService.BASE_USERS_URL + this.authService.getUser().id;
24 return this.authHttp.put(url, body)
25 .map(this.restExtractor.extractDataBool)
26 .catch((res) => this.restExtractor.handleError(res));