From 1378c0d343028f3d40d7d795422684ab9e6a1599 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 11:27:47 +0200 Subject: Fix client lint --- .../users/user-edit/user-create.component.ts | 15 +++++---- .../users/user-edit/user-password.component.ts | 11 +++--- .../users/user-edit/user-update.component.ts | 39 ++++++++++++---------- 3 files changed, 34 insertions(+), 31 deletions(-) (limited to 'client/src/app/+admin/users/user-edit') 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 { userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10) userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10) - this.userService.addUser(userCreate).subscribe( - () => { - this.notifier.success($localize`User ${userCreate.username} created.`) - this.router.navigate([ '/admin/users/list' ]) - }, + this.userService.addUser(userCreate) + .subscribe({ + next: () => { + this.notifier.success($localize`User ${userCreate.username} created.`) + this.router.navigate([ '/admin/users/list' ]) + }, - err => this.error = err.message - ) + error: err => this.error = err.message + }) } 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 { const userUpdate: UserUpdate = this.form.value - this.userService.updateUser(this.userId, userUpdate).subscribe( - () => { - this.notifier.success($localize`Password changed for user ${this.username}.`) - }, + this.userService.updateUser(this.userId, userUpdate) + .subscribe({ + next: () => this.notifier.success($localize`Password changed for user ${this.username}.`), - err => this.error = err.message - ) + error: err => this.error = err.message + }) } 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 { this.paramsSub = this.route.params.subscribe(routeParams => { const userId = routeParams['id'] - this.userService.getUser(userId, true).subscribe( - user => this.onUserFetched(user), + this.userService.getUser(userId, true) + .subscribe({ + next: user => this.onUserFetched(user), - err => this.error = err.message - ) + error: err => this.error = err.message + }) }) } @@ -83,14 +84,15 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { if (userUpdate.pluginAuth === 'null') userUpdate.pluginAuth = null - this.userService.updateUser(this.user.id, userUpdate).subscribe( - () => { - this.notifier.success($localize`User ${this.user.username} updated.`) - this.router.navigate([ '/admin/users/list' ]) - }, + this.userService.updateUser(this.user.id, userUpdate) + .subscribe({ + next: () => { + this.notifier.success($localize`User ${this.user.username} updated.`) + this.router.navigate([ '/admin/users/list' ]) + }, - err => this.error = err.message - ) + error: err => this.error = err.message + }) } isCreation () { @@ -106,13 +108,14 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { } resetPassword () { - this.userService.askResetPassword(this.user.email).subscribe( - () => { - this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`) - }, - - err => this.error = err.message - ) + this.userService.askResetPassword(this.user.email) + .subscribe({ + next: () => { + this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`) + }, + + error: err => this.error = err.message + }) } private onUserFetched (userJson: UserType) { -- cgit v1.2.3