diff options
Diffstat (limited to 'client/src/app/account/account.service.ts')
-rw-r--r-- | client/src/app/account/account.service.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/src/app/account/account.service.ts b/client/src/app/account/account.service.ts new file mode 100644 index 000000000..19b4e0624 --- /dev/null +++ b/client/src/app/account/account.service.ts | |||
@@ -0,0 +1,19 @@ | |||
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 | } | ||