diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:42:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 08:35:06 +0200 |
commit | 9df52d660feb722404be00a50f3c8a612bec1c15 (patch) | |
tree | dde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | |
parent | adb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff) | |
download | PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip |
Migrate client to eslint
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts index f91b2f37b..47e54dc23 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | |||
@@ -1,7 +1,11 @@ | |||
1 | import { filter } from 'rxjs/operators' | 1 | import { filter } from 'rxjs/operators' |
2 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
3 | import { AuthService, Notifier, UserService } from '@app/core' | 3 | import { AuthService, Notifier, UserService } from '@app/core' |
4 | import { USER_CONFIRM_PASSWORD_VALIDATOR, USER_PASSWORD_VALIDATOR, USER_EXISTING_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' | 4 | import { |
5 | USER_CONFIRM_PASSWORD_VALIDATOR, | ||
6 | USER_EXISTING_PASSWORD_VALIDATOR, | ||
7 | USER_PASSWORD_VALIDATOR | ||
8 | } from '@app/shared/form-validators/user-validators' | ||
5 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 9 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
6 | import { User } from '@shared/models' | 10 | import { User } from '@shared/models' |
7 | 11 | ||
@@ -19,7 +23,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On | |||
19 | private notifier: Notifier, | 23 | private notifier: Notifier, |
20 | private authService: AuthService, | 24 | private authService: AuthService, |
21 | private userService: UserService | 25 | private userService: UserService |
22 | ) { | 26 | ) { |
23 | super() | 27 | super() |
24 | } | 28 | } |
25 | 29 | ||
@@ -35,13 +39,13 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On | |||
35 | const confirmPasswordControl = this.form.get('new-confirmed-password') | 39 | const confirmPasswordControl = this.form.get('new-confirmed-password') |
36 | 40 | ||
37 | confirmPasswordControl.valueChanges | 41 | confirmPasswordControl.valueChanges |
38 | .pipe(filter(v => v !== this.form.value[ 'new-password' ])) | 42 | .pipe(filter(v => v !== this.form.value['new-password'])) |
39 | .subscribe(() => confirmPasswordControl.setErrors({ matchPassword: true })) | 43 | .subscribe(() => confirmPasswordControl.setErrors({ matchPassword: true })) |
40 | } | 44 | } |
41 | 45 | ||
42 | changePassword () { | 46 | changePassword () { |
43 | const currentPassword = this.form.value[ 'current-password' ] | 47 | const currentPassword = this.form.value['current-password'] |
44 | const newPassword = this.form.value[ 'new-password' ] | 48 | const newPassword = this.form.value['new-password'] |
45 | 49 | ||
46 | this.userService.changePassword(currentPassword, newPassword) | 50 | this.userService.changePassword(currentPassword, newPassword) |
47 | .subscribe({ | 51 | .subscribe({ |