aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/account/account.service.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-05 18:04:08 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-05 18:04:08 +0200
commit629d8d6f70cf83b55011dff53bfe1c4a95ac3433 (patch)
tree9d5a145609d9c693ddacfbc42ae75ca3c841aef0 /client/src/app/account/account.service.ts
parent99a64bfed25e45547df3045cf249bc895e6f220b (diff)
downloadPeerTube-629d8d6f70cf83b55011dff53bfe1c4a95ac3433.tar.gz
PeerTube-629d8d6f70cf83b55011dff53bfe1c4a95ac3433.tar.zst
PeerTube-629d8d6f70cf83b55011dff53bfe1c4a95ac3433.zip
Client: implement password change
Diffstat (limited to 'client/src/app/account/account.service.ts')
-rw-r--r--client/src/app/account/account.service.ts19
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 @@
1import { Injectable } from '@angular/core';
2
3import { AuthHttp, AuthService } from '../shared';
4
5@Injectable()
6export 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}