|
|
|
|
@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
|
|
|
|
|
import { PasswordHideShowComponent } from '../../shared/components/password-hide-show/password-hide-show.component';
|
|
|
|
|
import { URIKey } from '../../utils/uri-enums';
|
|
|
|
|
import { HttpURIService } from '../../app.http.uri.service';
|
|
|
|
|
import { StorageService } from '../../shared/services/storage.service';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-reset-password',
|
|
|
|
|
@ -20,11 +21,13 @@ export class ResetPasswordComponent implements OnInit{
|
|
|
|
|
@ViewChild('psh1') passwordHideShow1?: PasswordHideShowComponent;
|
|
|
|
|
@ViewChild('psh2') passwordHideShow2?: PasswordHideShowComponent;
|
|
|
|
|
|
|
|
|
|
constructor(private fb: FormBuilder, private httpURIService: HttpURIService){}
|
|
|
|
|
constructor(private fb: FormBuilder, private httpURIService: HttpURIService, private storageService: StorageService){}
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
|
const userIdValue = this.storageService.getItem('USER_ID')
|
|
|
|
|
this.resetPasswordForm = this.fb.group({
|
|
|
|
|
userId: ['', Validators.required],
|
|
|
|
|
|
|
|
|
|
userId: [userIdValue || '', Validators.required],
|
|
|
|
|
newPassword: ['', [Validators.required, Validators.minLength(6)]],
|
|
|
|
|
confirmPassword: ['', [Validators.required, Validators.minLength(6)]]
|
|
|
|
|
},
|
|
|
|
|
@ -76,7 +79,8 @@ export class ResetPasswordComponent implements OnInit{
|
|
|
|
|
|
|
|
|
|
const payload = {
|
|
|
|
|
userId: this.resetPasswordForm.value.userId,
|
|
|
|
|
newPassword: this.resetPasswordForm.value.newPassword
|
|
|
|
|
newPassword: this.resetPasswordForm.value.newPassword,
|
|
|
|
|
porOrgaCode: this.storageService.getItem('POR_ORGACODE')
|
|
|
|
|
};
|
|
|
|
|
this.httpURIService.requestPOST(URIKey.RESET_PASSWORD_URI, payload)
|
|
|
|
|
.subscribe();
|
|
|
|
|
|