Skip to content

Commit 2642ed3

Browse files
committed
[CST-6153] Use new params name
1 parent 5099d0b commit 2642ed3

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/app/core/eperson/eperson-data.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ describe('EPersonDataService', () => {
307307
it('should sent a patch request with an uuid, token and new password to the epersons endpoint', () => {
308308
service.patchPasswordWithToken('test-uuid', 'test-token', 'test-password');
309309

310-
const operation = Object.assign({ op: 'add', path: '/password', value: { password: 'test-password' } });
310+
const operation = Object.assign({ op: 'add', path: '/password', value: { new_password: 'test-password' } });
311311
const expected = new PatchRequest(requestService.generateRequestId(), epersonsEndpoint + '/test-uuid?token=test-token', [operation]);
312312

313313
expect(requestService.send).toHaveBeenCalledWith(expected);

src/app/core/eperson/eperson-data.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export class EPersonDataService extends IdentifiableDataService<EPerson> impleme
321321
patchPasswordWithToken(uuid: string, token: string, password: string): Observable<RemoteData<EPerson>> {
322322
const requestId = this.requestService.generateRequestId();
323323

324-
const operation = Object.assign({ op: 'add', path: '/password', value: { 'password': password } });
324+
const operation = Object.assign({ op: 'add', path: '/password', value: { 'new_password': password } });
325325

326326
const hrefObs = this.halService.getEndpoint(this.linkPath).pipe(
327327
map((endpoint: string) => this.getIDHref(endpoint, uuid)),

src/app/profile-page/profile-page.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ describe('ProfilePageComponent', () => {
219219
component.setCurrentPasswordValue('current-password');
220220

221221
operations = [
222-
{ 'op': 'add', 'path': '/password', 'value': { 'password': 'testest', 'challenge': 'current-password' } }
222+
{ 'op': 'add', 'path': '/password', 'value': { 'new_password': 'testest', 'current_password': 'current-password' } }
223223
];
224224
result = component.updateSecurity();
225225
});
@@ -243,7 +243,7 @@ describe('ProfilePageComponent', () => {
243243
component.setInvalid(false);
244244
component.setCurrentPasswordValue('current-password');
245245
operations = [
246-
{ 'op': 'add', 'path': '/password', 'value': {'password': 'testest', 'challenge': 'current-password' }}
246+
{ 'op': 'add', 'path': '/password', 'value': {'new_password': 'testest', 'current_password': 'current-password' }}
247247
];
248248
result = component.updateSecurity();
249249
epersonService.patch(user, operations).subscribe((response) => {

src/app/profile-page/profile-page.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class ProfilePageComponent implements OnInit {
147147
}
148148
if (!this.invalidSecurity && passEntered) {
149149
const operations = [
150-
{ 'op': 'add', 'path': '/password', 'value': { 'password': this.password, 'challenge': this.currentPassword } }
150+
{ 'op': 'add', 'path': '/password', 'value': { 'new_password': this.password, 'current_password': this.currentPassword } }
151151
] as Operation[];
152152
this.epersonService.patch(this.currentUser, operations).pipe(getFirstCompletedRemoteData()).subscribe((response: RemoteData<EPerson>) => {
153153
if (response.hasSucceeded) {

0 commit comments

Comments
 (0)