aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit/user-update.component.ts
diff options
context:
space:
mode:
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.ts39
1 files changed, 21 insertions, 18 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 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) {