diff options
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-update.component.ts')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-update.component.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts index 06bde582e..5821229b3 100644 --- a/client/src/app/+admin/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/users/user-edit/user-update.component.ts | |||
@@ -36,11 +36,12 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
36 | } | 36 | } |
37 | 37 | ||
38 | ngOnInit () { | 38 | ngOnInit () { |
39 | const defaultValues = { videoQuota: '-1' } | 39 | const defaultValues = { videoQuota: '-1', videoQuotaDaily: '-1' } |
40 | this.buildForm({ | 40 | this.buildForm({ |
41 | email: this.userValidatorsService.USER_EMAIL, | 41 | email: this.userValidatorsService.USER_EMAIL, |
42 | role: this.userValidatorsService.USER_ROLE, | 42 | role: this.userValidatorsService.USER_ROLE, |
43 | videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA | 43 | videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA, |
44 | videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY | ||
44 | }, defaultValues) | 45 | }, defaultValues) |
45 | 46 | ||
46 | this.paramsSub = this.route.params.subscribe(routeParams => { | 47 | this.paramsSub = this.route.params.subscribe(routeParams => { |
@@ -64,6 +65,7 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
64 | 65 | ||
65 | // A select in HTML is always mapped as a string, we convert it to number | 66 | // A select in HTML is always mapped as a string, we convert it to number |
66 | userUpdate.videoQuota = parseInt(this.form.value['videoQuota'], 10) | 67 | userUpdate.videoQuota = parseInt(this.form.value['videoQuota'], 10) |
68 | userUpdate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10) | ||
67 | 69 | ||
68 | this.userService.updateUser(this.userId, userUpdate).subscribe( | 70 | this.userService.updateUser(this.userId, userUpdate).subscribe( |
69 | () => { | 71 | () => { |
@@ -93,7 +95,8 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
93 | this.form.patchValue({ | 95 | this.form.patchValue({ |
94 | email: userJson.email, | 96 | email: userJson.email, |
95 | role: userJson.role, | 97 | role: userJson.role, |
96 | videoQuota: userJson.videoQuota | 98 | videoQuota: userJson.videoQuota, |
99 | videoQuotaDaily: userJson.videoQuotaDaily | ||
97 | }) | 100 | }) |
98 | } | 101 | } |
99 | } | 102 | } |