]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/account/account.service.ts
Client: navigate to /videos/list when do search on another page
[github/Chocobozzz/PeerTube.git] / client / src / app / account / account.service.ts
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 }