From 8094a8980265a0a28e508dbd7cf7c7029e6d98b6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 Sep 2017 21:29:39 +0200 Subject: Add user update for admins --- client/src/app/shared/users/user.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'client/src/app/shared/users') 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' import { AuthService } from '../../core' import { AuthHttp } from '../auth' import { RestExtractor } from '../rest' -import { UserCreate, UserUpdate } from '../../../../../shared' +import { UserCreate, UserUpdateMe } from '../../../../../shared' @Injectable() export class UserService { @@ -22,13 +22,13 @@ export class UserService { checkTokenValidity () { const url = UserService.BASE_USERS_URL + 'me' - // AuthHttp will redirect us to the login page if the oken is not valid anymore + // AuthHttp will redirect us to the login page if the token is not valid anymore this.authHttp.get(url).subscribe() } changePassword (newPassword: string) { - const url = UserService.BASE_USERS_URL + this.authService.getUser().id - const body: UserUpdate = { + const url = UserService.BASE_USERS_URL + 'me' + const body: UserUpdateMe = { password: newPassword } @@ -37,8 +37,8 @@ export class UserService { .catch((res) => this.restExtractor.handleError(res)) } - updateDetails (details: UserUpdate) { - const url = UserService.BASE_USERS_URL + this.authService.getUser().id + updateMyDetails (details: UserUpdateMe) { + const url = UserService.BASE_USERS_URL + 'me' return this.authHttp.put(url, details) .map(this.restExtractor.extractDataBool) -- cgit v1.2.3