diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-10 19:43:21 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-10 19:43:21 +0200 |
commit | 4771e0008dd26eadbb7eaff64255a6ec914fdadb (patch) | |
tree | 4fd58f8a3f3c2d674b936c99817b4f5fb958c5d8 /client/src/app/+admin/users/user-add/user-add.component.ts | |
parent | 7a214f746bf420defbf17fa218d90d6233551bf8 (diff) | |
download | PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.gz PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.zst PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.zip |
Better typescript typing for a better world
Diffstat (limited to 'client/src/app/+admin/users/user-add/user-add.component.ts')
-rw-r--r-- | client/src/app/+admin/users/user-add/user-add.component.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/+admin/users/user-add/user-add.component.ts b/client/src/app/+admin/users/user-add/user-add.component.ts index 2d25ab469..0dd99eccd 100644 --- a/client/src/app/+admin/users/user-add/user-add.component.ts +++ b/client/src/app/+admin/users/user-add/user-add.component.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | USER_EMAIL, | 11 | USER_EMAIL, |
12 | USER_PASSWORD | 12 | USER_PASSWORD |
13 | } from '../../../shared' | 13 | } from '../../../shared' |
14 | import { UserCreate } from '../../../../../../shared' | ||
14 | 15 | ||
15 | @Component({ | 16 | @Component({ |
16 | selector: 'my-user-add', | 17 | selector: 'my-user-add', |
@@ -57,11 +58,11 @@ export class UserAddComponent extends FormReactive implements OnInit { | |||
57 | addUser () { | 58 | addUser () { |
58 | this.error = null | 59 | this.error = null |
59 | 60 | ||
60 | const { username, password, email } = this.form.value | 61 | const userCreate: UserCreate = this.form.value |
61 | 62 | ||
62 | this.userService.addUser(username, password, email).subscribe( | 63 | this.userService.addUser(userCreate).subscribe( |
63 | () => { | 64 | () => { |
64 | this.notificationsService.success('Success', `User ${username} created.`) | 65 | this.notificationsService.success('Success', `User ${userCreate.username} created.`) |
65 | this.router.navigate([ '/admin/users/list' ]) | 66 | this.router.navigate([ '/admin/users/list' ]) |
66 | }, | 67 | }, |
67 | 68 | ||