aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.service.ts
diff options
context:
space:
mode:
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)