]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
move user-password to Input decorator
authorRigel Kent <sendmemail@rigelk.eu>
Mon, 8 Oct 2018 19:05:57 +0000 (21:05 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 11 Feb 2019 08:26:39 +0000 (09:26 +0100)
client/src/app/+admin/users/user-edit/user-edit.component.html
client/src/app/+admin/users/user-edit/user-password.component.ts

index b06c91ff38cad5d4f0544c6ec6381eded67b31b2..6944ec4358804044f2cd493aab4e144c01c86802 100644 (file)
@@ -88,4 +88,4 @@
 <button (click)="resetPassword()" i18n>Ask for new password</button>
 
 <p class="mt-4" i18n>Manually set the user password</p>
-<my-user-password></my-user-password>
+<my-user-password userId="userId"></my-user-password>
index 1f9ccb4e81e9de2ea31eb0cee268824bb66e930a..99c4c8a59998fd242e2043a943ed1510e25a91d8 100644 (file)
@@ -19,10 +19,11 @@ import { FormReactive } from '../../../shared'
 })
 export class UserPasswordComponent extends FormReactive implements OnInit, OnDestroy {
   error: string
-  userId: number
   username: string
   showPassword = false
 
+  @Input() userId: number
+
   private paramsSub: Subscription
 
   constructor (
@@ -43,15 +44,6 @@ export class UserPasswordComponent extends FormReactive implements OnInit, OnDes
     this.buildForm({
       password: this.userValidatorsService.USER_PASSWORD
     })
-
-    this.paramsSub = this.route.params.subscribe(routeParams => {
-      const userId = routeParams['id']
-      this.userService.getUser(userId).subscribe(
-        user => this.onUserFetched(user),
-
-        err => this.error = err.message
-      )
-    })
   }
 
   ngOnDestroy () {