aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/users/user-edit')
-rw-r--r--client/src/app/+admin/users/user-edit/user-create.component.ts15
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.ts11
-rw-r--r--client/src/app/+admin/users/user-edit/user-update.component.ts39
3 files changed, 34 insertions, 31 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 c26ad1208..8403db91a 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
@@ -71,14 +71,15 @@ export class UserCreateComponent extends UserEdit implements OnInit {
71 userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10) 71 userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10)
72 userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10) 72 userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10)
73 73
74 this.userService.addUser(userCreate).subscribe( 74 this.userService.addUser(userCreate)
75 () => { 75 .subscribe({
76 this.notifier.success($localize`User ${userCreate.username} created.`) 76 next: () => {
77 this.router.navigate([ '/admin/users/list' ]) 77 this.notifier.success($localize`User ${userCreate.username} created.`)
78 }, 78 this.router.navigate([ '/admin/users/list' ])
79 },
79 80
80 err => this.error = err.message 81 error: err => this.error = err.message
81 ) 82 })
82 } 83 }
83 84
84 isCreation () { 85 isCreation () {
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts
index 05d52b17f..7c42b9241 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-password.component.ts
@@ -35,13 +35,12 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
35 35
36 const userUpdate: UserUpdate = this.form.value 36 const userUpdate: UserUpdate = this.form.value
37 37
38 this.userService.updateUser(this.userId, userUpdate).subscribe( 38 this.userService.updateUser(this.userId, userUpdate)
39 () => { 39 .subscribe({
40 this.notifier.success($localize`Password changed for user ${this.username}.`) 40 next: () => this.notifier.success($localize`Password changed for user ${this.username}.`),
41 },
42 41
43 err => this.error = err.message 42 error: err => this.error = err.message
44 ) 43 })
45 } 44 }
46 45
47 togglePasswordVisibility () { 46 togglePasswordVisibility () {
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 1527508f7..2128ba4fd 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
@@ -59,11 +59,12 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
59 59
60 this.paramsSub = this.route.params.subscribe(routeParams => { 60 this.paramsSub = this.route.params.subscribe(routeParams => {
61 const userId = routeParams['id'] 61 const userId = routeParams['id']
62 this.userService.getUser(userId, true).subscribe( 62 this.userService.getUser(userId, true)
63 user => this.onUserFetched(user), 63 .subscribe({
64 next: user => this.onUserFetched(user),
64 65
65 err => this.error = err.message 66 error: err => this.error = err.message
66 ) 67 })
67 }) 68 })
68 } 69 }
69 70
@@ -83,14 +84,15 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
83 84
84 if (userUpdate.pluginAuth === 'null') userUpdate.pluginAuth = null 85 if (userUpdate.pluginAuth === 'null') userUpdate.pluginAuth = null
85 86
86 this.userService.updateUser(this.user.id, userUpdate).subscribe( 87 this.userService.updateUser(this.user.id, userUpdate)
87 () => { 88 .subscribe({
88 this.notifier.success($localize`User ${this.user.username} updated.`) 89 next: () => {
89 this.router.navigate([ '/admin/users/list' ]) 90 this.notifier.success($localize`User ${this.user.username} updated.`)
90 }, 91 this.router.navigate([ '/admin/users/list' ])
92 },
91 93
92 err => this.error = err.message 94 error: err => this.error = err.message
93 ) 95 })
94 } 96 }
95 97
96 isCreation () { 98 isCreation () {
@@ -106,13 +108,14 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
106 } 108 }
107 109
108 resetPassword () { 110 resetPassword () {
109 this.userService.askResetPassword(this.user.email).subscribe( 111 this.userService.askResetPassword(this.user.email)
110 () => { 112 .subscribe({
111 this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`) 113 next: () => {
112 }, 114 this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`)
113 115 },
114 err => this.error = err.message 116
115 ) 117 error: err => this.error = err.message
118 })
116 } 119 }
117 120
118 private onUserFetched (userJson: UserType) { 121 private onUserFetched (userJson: UserType) {