|
|
|
|
@ -46,7 +46,7 @@ export class ResetPasswordComponent implements OnInit{
|
|
|
|
|
|
|
|
|
|
initializeForm(): void {
|
|
|
|
|
this.resetPasswordForm = this.fb.group({
|
|
|
|
|
userId: ['', Validators.required], // Changed to empty string and required
|
|
|
|
|
userId: [null, Validators.required], // Changed to empty string and required
|
|
|
|
|
newPassword: ['', [
|
|
|
|
|
Validators.required,
|
|
|
|
|
Validators.minLength(8),
|
|
|
|
|
@ -105,7 +105,6 @@ export class ResetPasswordComponent implements OnInit{
|
|
|
|
|
this.isSubmitting = true;
|
|
|
|
|
const selectedId = this.resetPasswordForm.get('userId')?.value;
|
|
|
|
|
|
|
|
|
|
console.log("userid.....", selectedId);
|
|
|
|
|
|
|
|
|
|
const payload = {
|
|
|
|
|
userId: selectedId,
|
|
|
|
|
@ -119,10 +118,6 @@ export class ResetPasswordComponent implements OnInit{
|
|
|
|
|
this.i18nService.success(SuccessMessages.RESET_PASSWORD_SUCCESS, []);
|
|
|
|
|
this.resetForm(); // Reset form after successful submission
|
|
|
|
|
|
|
|
|
|
// Optional: Navigate to dashboard or stay on page
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.router.navigate(['/dashboard']);
|
|
|
|
|
}, 1500);
|
|
|
|
|
}
|
|
|
|
|
this.isSubmitting = false;
|
|
|
|
|
},
|
|
|
|
|
@ -160,7 +155,7 @@ export class ResetPasswordComponent implements OnInit{
|
|
|
|
|
// Reset ng-select by clearing the value
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.resetPasswordForm.patchValue({
|
|
|
|
|
userId: '',
|
|
|
|
|
userId: null,
|
|
|
|
|
newPassword: '',
|
|
|
|
|
confirmPassword: ''
|
|
|
|
|
});
|
|
|
|
|
|