-import { Component, OnDestroy, OnInit } from '@angular/core'
+import { Component, OnDestroy, OnInit, Input } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { Subscription } from 'rxjs'
import { Notifier } from '@app/core'
export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
error: string
userId: number
+ userEmail: string
username: string
private paramsSub: Subscription
return this.i18n('Update user')
}
+ resetPassword () {
+ this.userService.askResetPassword(this.userEmail).subscribe(
+ () => {
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('An email asking for password reset has been sent to {{username}}.', { username: this.username })
+ )
+ },
+
+ err => this.error = err.message
+ )
+ }
+
private onUserFetched (userJson: User) {
this.userId = userJson.id
this.username = userJson.username
+ this.userEmail = userJson.email
this.form.patchValue({
email: userJson.email,