aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.service.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-09-05 21:29:39 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-09-05 21:29:39 +0200
commit8094a8980265a0a28e508dbd7cf7c7029e6d98b6 (patch)
tree26be2b9b43dfe485ea14eb53d3a1adb6247c35f8 /client/src/app/shared/users/user.service.ts
parent980246ea8f1c51a137eaf0c441ef7e3b6fb88810 (diff)
downloadPeerTube-8094a8980265a0a28e508dbd7cf7c7029e6d98b6.tar.gz
PeerTube-8094a8980265a0a28e508dbd7cf7c7029e6d98b6.tar.zst
PeerTube-8094a8980265a0a28e508dbd7cf7c7029e6d98b6.zip
Add user update for admins
Diffstat (limited to 'client/src/app/shared/users/user.service.ts')
-rw-r--r--client/src/app/shared/users/user.service.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts
index b479ac034..35180be4d 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/shared/users/user.service.ts
@@ -6,7 +6,7 @@ import 'rxjs/add/operator/map'
6import { AuthService } from '../../core' 6import { AuthService } from '../../core'
7import { AuthHttp } from '../auth' 7import { AuthHttp } from '../auth'
8import { RestExtractor } from '../rest' 8import { RestExtractor } from '../rest'
9import { UserCreate, UserUpdate } from '../../../../../shared' 9import { UserCreate, UserUpdateMe } from '../../../../../shared'
10 10
11@Injectable() 11@Injectable()
12export class UserService { 12export class UserService {
@@ -22,13 +22,13 @@ export class UserService {
22 checkTokenValidity () { 22 checkTokenValidity () {
23 const url = UserService.BASE_USERS_URL + 'me' 23 const url = UserService.BASE_USERS_URL + 'me'
24 24
25 // AuthHttp will redirect us to the login page if the oken is not valid anymore 25 // AuthHttp will redirect us to the login page if the token is not valid anymore
26 this.authHttp.get(url).subscribe() 26 this.authHttp.get(url).subscribe()
27 } 27 }
28 28
29 changePassword (newPassword: string) { 29 changePassword (newPassword: string) {
30 const url = UserService.BASE_USERS_URL + this.authService.getUser().id 30 const url = UserService.BASE_USERS_URL + 'me'
31 const body: UserUpdate = { 31 const body: UserUpdateMe = {
32 password: newPassword 32 password: newPassword
33 } 33 }
34 34
@@ -37,8 +37,8 @@ export class UserService {
37 .catch((res) => this.restExtractor.handleError(res)) 37 .catch((res) => this.restExtractor.handleError(res))
38 } 38 }
39 39
40 updateDetails (details: UserUpdate) { 40 updateMyDetails (details: UserUpdateMe) {
41 const url = UserService.BASE_USERS_URL + this.authService.getUser().id 41 const url = UserService.BASE_USERS_URL + 'me'
42 42
43 return this.authHttp.put(url, details) 43 return this.authHttp.put(url, details)
44 .map(this.restExtractor.extractDataBool) 44 .map(this.restExtractor.extractDataBool)