From 9ec3c4c3ef626270c4b6c337ed90069bc766685c Mon Sep 17 00:00:00 2001 From: Mazdak Gibran <141390141+mazdakgibran@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:02:23 +0500 Subject: [PATCH] fixed issues in reset password screen --- .../reset-password/reset-password.component.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/app/user-management/reset-password/reset-password.component.ts b/src/app/user-management/reset-password/reset-password.component.ts index 6e09527..3f1fcef 100644 --- a/src/app/user-management/reset-password/reset-password.component.ts +++ b/src/app/user-management/reset-password/reset-password.component.ts @@ -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: '' });