X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Faccount%2Faccount.component.ts;h=3d3677ab09b106f506a483906ae4e57d4b1b7dc5;hb=202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7;hp=5c42103f878643dc171e1daba7d6be22cc91d72a;hpb=629d8d6f70cf83b55011dff53bfe1c4a95ac3433;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/account/account.component.ts b/client/src/app/account/account.component.ts index 5c42103f8..3d3677ab0 100644 --- a/client/src/app/account/account.component.ts +++ b/client/src/app/account/account.component.ts @@ -1,45 +1,8 @@ -import { Control, ControlGroup, Validators } from '@angular/common'; -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; - -import { AccountService } from './account.service'; +import { Component } from '@angular/core' @Component({ selector: 'my-account', - template: require('./account.component.html'), - providers: [ AccountService ] + templateUrl: './account.component.html', + styleUrls: [ './account.component.scss' ] }) - -export class AccountComponent implements OnInit { - changePasswordForm: ControlGroup; - information: string = null; - error: string = null; - - constructor( - private accountService: AccountService, - private router: Router - ) {} - - ngOnInit() { - this.changePasswordForm = new ControlGroup({ - newPassword: new Control('', Validators.compose([ Validators.required, Validators.minLength(6) ])), - newConfirmedPassword: new Control('', Validators.compose([ Validators.required, Validators.minLength(6) ])), - }); - } - - changePassword(newPassword: string, newConfirmedPassword: string) { - this.information = null; - this.error = null; - - if (newPassword !== newConfirmedPassword) { - this.error = 'The new password and the confirmed password do not correspond.'; - return; - } - - this.accountService.changePassword(newPassword).subscribe( - ok => this.information = 'Password updated.', - - err => this.error = err - ); - } -} +export class AccountComponent {}