diff --git a/src/app/core/eperson/eperson-data.service.spec.ts b/src/app/core/eperson/eperson-data.service.spec.ts index a1a6951545..6fde34b9a5 100644 --- a/src/app/core/eperson/eperson-data.service.spec.ts +++ b/src/app/core/eperson/eperson-data.service.spec.ts @@ -303,7 +303,7 @@ describe('EPersonDataService', () => { it('should sent a patch request with an uuid, token and new password to the epersons endpoint', () => { service.patchPasswordWithToken('test-uuid', 'test-token','test-password'); - const operation = Object.assign({ op: 'replace', path: '/password', value: 'test-password' }); + const operation = Object.assign({ op: 'add', path: '/password', value: 'test-password' }); const expected = new PatchRequest(requestService.generateRequestId(), epersonsEndpoint + '/test-uuid?token=test-token', [operation]); expect(requestService.configure).toHaveBeenCalledWith(expected); diff --git a/src/app/core/eperson/eperson-data.service.ts b/src/app/core/eperson/eperson-data.service.ts index a1428aee73..5fc4c6497f 100644 --- a/src/app/core/eperson/eperson-data.service.ts +++ b/src/app/core/eperson/eperson-data.service.ts @@ -280,7 +280,7 @@ export class EPersonDataService extends DataService { patchPasswordWithToken(uuid: string, token: string, password: string): Observable { const requestId = this.requestService.generateRequestId(); - const operation = Object.assign({ op: 'replace', path: '/password', value: password }); + const operation = Object.assign({ op: 'add', path: '/password', value: password }); const hrefObs = this.halService.getEndpoint(this.linkPath).pipe( map((endpoint: string) => this.getIDHref(endpoint, uuid)), diff --git a/src/app/profile-page/profile-page.component.spec.ts b/src/app/profile-page/profile-page.component.spec.ts index 8d78539bab..418626e4d1 100644 --- a/src/app/profile-page/profile-page.component.spec.ts +++ b/src/app/profile-page/profile-page.component.spec.ts @@ -177,7 +177,7 @@ describe('ProfilePageComponent', () => { component.setPasswordValue('testest'); component.setInvalid(false); - operations = [{op: 'replace', path: '/password', value: 'testest'}]; + operations = [{op: 'add', path: '/password', value: 'testest'}]; result = component.updateSecurity(); }); diff --git a/src/app/profile-page/profile-page.component.ts b/src/app/profile-page/profile-page.component.ts index bc06c49f81..4ae644a633 100644 --- a/src/app/profile-page/profile-page.component.ts +++ b/src/app/profile-page/profile-page.component.ts @@ -120,7 +120,7 @@ export class ProfilePageComponent implements OnInit { this.notificationsService.error(this.translate.instant(this.PASSWORD_NOTIFICATIONS_PREFIX + 'error.general')); } if (!this.invalidSecurity && passEntered) { - const operation = Object.assign({op: 'replace', path: '/password', value: this.password}); + const operation = Object.assign({op: 'add', path: '/password', value: this.password}); this.epersonService.patch(this.currentUser, [operation]).subscribe((response: RestResponse) => { if (response.isSuccessful) { this.notificationsService.success(