reset user password api

reset user password api integration
mazdak/UX-1861
Mazdak Gibran 4 weeks ago
parent 2756a3faa5
commit 5955ad90a5

@ -122,7 +122,8 @@ constructor(private fb: FormBuilder, private httpURIService: HttpURIService, pri
oldPassword: form.get('oldPassword')?.value || null, oldPassword: form.get('oldPassword')?.value || null,
// confirmPassword: form.get('confirmPassword')?.value || null, // confirmPassword: form.get('confirmPassword')?.value || null,
newPassword: form.get('newPassword')?.value, newPassword: form.get('newPassword')?.value,
userId: this.storageService.getItem('USER_ID') userId: this.storageService.getItem('USER_ID'),
porOrgaCode: this.storageService.getItem('POR_ORGACODE')
}; };
} }
onSubmit(){ onSubmit(){

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

@ -49,7 +49,7 @@
}, },
{ {
"Id" : "ENTITY_RESET_PASSWORD_URI", "Id" : "ENTITY_RESET_PASSWORD_URI",
"URI": "/user/resetPassword", "URI": "/authentication/reset-password",
"UUID": "RESET_PASSWORD_URI" "UUID": "RESET_PASSWORD_URI"
}, },
{ {

Loading…
Cancel
Save