diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-15 10:49:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-15 14:39:52 +0200 |
commit | 1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a (patch) | |
tree | 91a10310cdf924779527525d39f8eb7e09e4ba49 /client/src/app/+admin/users/user-edit/user-create.component.ts | |
parent | 31b48aad478506d4214586f02792816efa968e4b (diff) | |
download | PeerTube-1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a.tar.gz PeerTube-1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a.tar.zst PeerTube-1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a.zip |
Add user adminFlags
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-create.component.ts')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-create.component.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts index 137ecfcbd..9a6801806 100644 --- a/client/src/app/+admin/users/user-edit/user-create.component.ts +++ b/client/src/app/+admin/users/user-edit/user-create.component.ts | |||
@@ -8,6 +8,7 @@ import { FormValidatorService } from '@app/shared/forms/form-validators/form-val | |||
8 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | 8 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' |
9 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 9 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
10 | import { UserService } from '@app/shared' | 10 | import { UserService } from '@app/shared' |
11 | import { UserAdminFlag } from '@shared/models/users/user-flag.model' | ||
11 | 12 | ||
12 | @Component({ | 13 | @Component({ |
13 | selector: 'my-user-create', | 14 | selector: 'my-user-create', |
@@ -45,7 +46,8 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
45 | password: this.userValidatorsService.USER_PASSWORD, | 46 | password: this.userValidatorsService.USER_PASSWORD, |
46 | role: this.userValidatorsService.USER_ROLE, | 47 | role: this.userValidatorsService.USER_ROLE, |
47 | videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA, | 48 | videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA, |
48 | videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY | 49 | videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY, |
50 | byPassAutoBlacklist: null | ||
49 | }, defaultValues) | 51 | }, defaultValues) |
50 | } | 52 | } |
51 | 53 | ||
@@ -54,8 +56,11 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
54 | 56 | ||
55 | const userCreate: UserCreate = this.form.value | 57 | const userCreate: UserCreate = this.form.value |
56 | 58 | ||
59 | userCreate.adminFlags = this.buildAdminFlags(this.form.value) | ||
60 | |||
57 | // A select in HTML is always mapped as a string, we convert it to number | 61 | // A select in HTML is always mapped as a string, we convert it to number |
58 | userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10) | 62 | userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10) |
63 | userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10) | ||
59 | 64 | ||
60 | this.userService.addUser(userCreate).subscribe( | 65 | this.userService.addUser(userCreate).subscribe( |
61 | () => { | 66 | () => { |