diff options
Diffstat (limited to 'client/src/app/account/account.service.ts')
-rw-r--r-- | client/src/app/account/account.service.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/client/src/app/account/account.service.ts b/client/src/app/account/account.service.ts deleted file mode 100644 index 046690347..000000000 --- a/client/src/app/account/account.service.ts +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core'; | ||
2 | import 'rxjs/add/operator/catch'; | ||
3 | import 'rxjs/add/operator/map'; | ||
4 | |||
5 | import { AuthService } from '../core'; | ||
6 | import { AuthHttp, RestExtractor } from '../shared'; | ||
7 | |||
8 | @Injectable() | ||
9 | export class AccountService { | ||
10 | private static BASE_USERS_URL = '/api/v1/users/'; | ||
11 | |||
12 | constructor( | ||
13 | private authHttp: AuthHttp, | ||
14 | private authService: AuthService, | ||
15 | private restExtractor: RestExtractor | ||
16 | ) {} | ||
17 | |||
18 | changePassword(newPassword: string) { | ||
19 | const url = AccountService.BASE_USERS_URL + this.authService.getUser().id; | ||
20 | const body = { | ||
21 | password: newPassword | ||
22 | }; | ||
23 | |||
24 | return this.authHttp.put(url, body) | ||
25 | .map(this.restExtractor.extractDataBool) | ||
26 | .catch((res) => this.restExtractor.handleError(res)); | ||
27 | } | ||
28 | } | ||