1 import { Injectable } from '@angular/core';
3 import { AuthService } from '../core';
4 import { AuthHttp, RestExtractor } from '../shared';
7 export class AccountService {
8 private static BASE_USERS_URL = '/api/v1/users/';
11 private authHttp: AuthHttp,
12 private authService: AuthService,
13 private restExtractor: RestExtractor
16 changePassword(newPassword: string) {
17 const url = AccountService.BASE_USERS_URL + this.authService.getUser().id;
22 return this.authHttp.put(url, body)
23 .map(this.restExtractor.extractDataBool)
24 .catch((res) => this.restExtractor.handleError(res));