diff options
Diffstat (limited to 'client/src/app/+admin/users/shared')
-rw-r--r-- | client/src/app/+admin/users/shared/user.service.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts index ffd7ba7da..999013bcc 100644 --- a/client/src/app/+admin/users/shared/user.service.ts +++ b/client/src/app/+admin/users/shared/user.service.ts | |||
@@ -5,7 +5,7 @@ import 'rxjs/add/operator/map' | |||
5 | import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe' | 5 | import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe' |
6 | 6 | ||
7 | import { AuthHttp, RestExtractor, RestDataSource, User } from '../../../shared' | 7 | import { AuthHttp, RestExtractor, RestDataSource, User } from '../../../shared' |
8 | import { UserCreate } from '../../../../../../shared' | 8 | import { UserCreate, UserUpdate } from '../../../../../../shared' |
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class UserService { | 11 | export class UserService { |
@@ -23,6 +23,18 @@ export class UserService { | |||
23 | .catch(this.restExtractor.handleError) | 23 | .catch(this.restExtractor.handleError) |
24 | } | 24 | } |
25 | 25 | ||
26 | updateUser (userId: number, userUpdate: UserUpdate) { | ||
27 | return this.authHttp.put(UserService.BASE_USERS_URL + userId, userUpdate) | ||
28 | .map(this.restExtractor.extractDataBool) | ||
29 | .catch(this.restExtractor.handleError) | ||
30 | } | ||
31 | |||
32 | getUser (userId: number) { | ||
33 | return this.authHttp.get(UserService.BASE_USERS_URL + userId) | ||
34 | .map(this.restExtractor.extractDataGet) | ||
35 | .catch(this.restExtractor.handleError) | ||
36 | } | ||
37 | |||
26 | getDataSource () { | 38 | getDataSource () { |
27 | return new RestDataSource(this.authHttp, UserService.BASE_USERS_URL, this.formatDataSource.bind(this)) | 39 | return new RestDataSource(this.authHttp, UserService.BASE_USERS_URL, this.formatDataSource.bind(this)) |
28 | } | 40 | } |