]>
Commit | Line | Data |
---|---|---|
629d8d6f C |
1 | import { Injectable } from '@angular/core'; |
2 | ||
3 | import { AuthHttp, AuthService } from '../shared'; | |
4 | ||
5 | @Injectable() | |
6 | export class AccountService { | |
7 | private static BASE_USERS_URL = '/api/v1/users/'; | |
8 | ||
9 | constructor(private authHttp: AuthHttp, private authService: AuthService) { } | |
10 | ||
11 | changePassword(newPassword: string) { | |
12 | const url = AccountService.BASE_USERS_URL + this.authService.getUser().id; | |
13 | const body = { | |
14 | password: newPassword | |
15 | }; | |
16 | ||
17 | return this.authHttp.put(url, body); | |
18 | } | |
19 | } |