]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/account/account.component.ts
Begin videos of an account
[github/Chocobozzz/PeerTube.git] / client / src / app / account / account.component.ts
index a22738d3f509a6ce011db8a7140ea923ff22c266..3d3677ab09b106f506a483906ae4e57d4b1b7dc5 100644 (file)
@@ -1,47 +1,8 @@
-import {  } from '@angular/common';
-import { Component, OnInit } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
-import { Router } from '@angular/router';
-
-import { AccountService } from './account.service';
+import { Component } from '@angular/core'
 
 @Component({
   selector: 'my-account',
-  template: require('./account.component.html')
+  templateUrl: './account.component.html',
+  styleUrls: [ './account.component.scss' ]
 })
-
-export class AccountComponent implements OnInit {
-  newPassword = '';
-  newConfirmedPassword = '';
-  changePasswordForm: FormGroup;
-  information: string = null;
-  error: string = null;
-
-  constructor(
-    private accountService: AccountService,
-    private router: Router
-  ) {}
-
-  ngOnInit() {
-    this.changePasswordForm = new FormGroup({
-      'new-password': new FormControl('', [ <any>Validators.required, <any>Validators.minLength(6) ]),
-      'new-confirmed-password': new FormControl('', [ <any>Validators.required, <any>Validators.minLength(6) ]),
-    });
-  }
-
-  changePassword() {
-    this.information = null;
-    this.error = null;
-
-    if (this.newPassword !== this.newConfirmedPassword) {
-      this.error = 'The new password and the confirmed password do not correspond.';
-      return;
-    }
-
-    this.accountService.changePassword(this.newPassword).subscribe(
-      ok => this.information = 'Password updated.',
-
-      err => this.error = err
-    );
-  }
-}
+export class AccountComponent {}