diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 14:32:15 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 14:32:15 +0200 |
commit | df98563e2104b82b119c00a3cd83cd0dc1242d25 (patch) | |
tree | a9720bf01bac9ad5646bd3d3c9bc7653617afdad /client/src/app/+admin/users/shared/user.service.ts | |
parent | 46757b477c1adb5f98060d15998a3852e18902a6 (diff) | |
download | PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.gz PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.zst PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.zip |
Use typescript standard and lint all files
Diffstat (limited to 'client/src/app/+admin/users/shared/user.service.ts')
-rw-r--r-- | client/src/app/+admin/users/shared/user.service.ts | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts index 9c7176d39..d52993a29 100644 --- a/client/src/app/+admin/users/shared/user.service.ts +++ b/client/src/app/+admin/users/shared/user.service.ts | |||
@@ -1,35 +1,35 @@ | |||
1 | import { Injectable } from '@angular/core'; | 1 | import { Injectable } from '@angular/core' |
2 | import 'rxjs/add/operator/catch'; | 2 | import 'rxjs/add/operator/catch' |
3 | import 'rxjs/add/operator/map'; | 3 | import 'rxjs/add/operator/map' |
4 | 4 | ||
5 | import { AuthHttp, RestExtractor, RestDataSource, User } from '../../../shared'; | 5 | import { AuthHttp, RestExtractor, RestDataSource, User } from '../../../shared' |
6 | 6 | ||
7 | @Injectable() | 7 | @Injectable() |
8 | export class UserService { | 8 | export class UserService { |
9 | private static BASE_USERS_URL = API_URL + '/api/v1/users/'; | 9 | private static BASE_USERS_URL = API_URL + '/api/v1/users/' |
10 | 10 | ||
11 | constructor( | 11 | constructor ( |
12 | private authHttp: AuthHttp, | 12 | private authHttp: AuthHttp, |
13 | private restExtractor: RestExtractor | 13 | private restExtractor: RestExtractor |
14 | ) {} | 14 | ) {} |
15 | 15 | ||
16 | addUser(username: string, password: string, email: string) { | 16 | addUser (username: string, password: string, email: string) { |
17 | const body = { | 17 | const body = { |
18 | username, | 18 | username, |
19 | email, | 19 | email, |
20 | password | 20 | password |
21 | }; | 21 | } |
22 | 22 | ||
23 | return this.authHttp.post(UserService.BASE_USERS_URL, body) | 23 | return this.authHttp.post(UserService.BASE_USERS_URL, body) |
24 | .map(this.restExtractor.extractDataBool) | 24 | .map(this.restExtractor.extractDataBool) |
25 | .catch(this.restExtractor.handleError); | 25 | .catch(this.restExtractor.handleError) |
26 | } | 26 | } |
27 | 27 | ||
28 | getDataSource() { | 28 | getDataSource () { |
29 | return new RestDataSource(this.authHttp, UserService.BASE_USERS_URL); | 29 | return new RestDataSource(this.authHttp, UserService.BASE_USERS_URL) |
30 | } | 30 | } |
31 | 31 | ||
32 | removeUser(user: User) { | 32 | removeUser (user: User) { |
33 | return this.authHttp.delete(UserService.BASE_USERS_URL + user.id); | 33 | return this.authHttp.delete(UserService.BASE_USERS_URL + user.id) |
34 | } | 34 | } |
35 | } | 35 | } |