Fix param to send user the forgot password email

This commit is contained in:
Tim Donohue
2023-02-16 14:09:35 -06:00
parent 0733e2766d
commit 92f2196135
2 changed files with 3 additions and 3 deletions

View File

@@ -537,7 +537,7 @@ describe('EPersonFormComponent', () => {
}); });
it('should call epersonRegistrationService.registerEmail', () => { it('should call epersonRegistrationService.registerEmail', () => {
expect(epersonRegistrationService.registerEmail).toHaveBeenCalledWith(ePersonEmail, null, 'register'); expect(epersonRegistrationService.registerEmail).toHaveBeenCalledWith(ePersonEmail, null, 'forgot');
}); });
}); });
}); });

View File

@@ -36,7 +36,7 @@ import { followLink } from '../../../shared/utils/follow-link-config.model';
import { ValidateEmailNotTaken } from './validators/email-taken.validator'; import { ValidateEmailNotTaken } from './validators/email-taken.validator';
import { Registration } from '../../../core/shared/registration.model'; import { Registration } from '../../../core/shared/registration.model';
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service'; import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
import { TYPE_REQUEST_REGISTER } from '../../../register-email-form/register-email-form.component'; import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component';
@Component({ @Component({
selector: 'ds-eperson-form', selector: 'ds-eperson-form',
@@ -492,7 +492,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
*/ */
resetPassword() { resetPassword() {
if (hasValue(this.epersonInitial.email)) { if (hasValue(this.epersonInitial.email)) {
this.epersonRegistrationService.registerEmail(this.epersonInitial.email, null, TYPE_REQUEST_REGISTER).pipe(getFirstCompletedRemoteData()) this.epersonRegistrationService.registerEmail(this.epersonInitial.email, null, TYPE_REQUEST_FORGOT).pipe(getFirstCompletedRemoteData())
.subscribe((response: RemoteData<Registration>) => { .subscribe((response: RemoteData<Registration>) => {
if (response.hasSucceeded) { if (response.hasSucceeded) {
this.notificationsService.success(this.translateService.get('admin.access-control.epeople.actions.reset'), this.notificationsService.success(this.translateService.get('admin.access-control.epeople.actions.reset'),