mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[CST-6153] Use new params name
This commit is contained in:
@@ -307,7 +307,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: 'add', path: '/password', value: { password: 'test-password' } });
|
||||
const operation = Object.assign({ op: 'add', path: '/password', value: { new_password: 'test-password' } });
|
||||
const expected = new PatchRequest(requestService.generateRequestId(), epersonsEndpoint + '/test-uuid?token=test-token', [operation]);
|
||||
|
||||
expect(requestService.send).toHaveBeenCalledWith(expected);
|
||||
|
@@ -321,7 +321,7 @@ export class EPersonDataService extends IdentifiableDataService<EPerson> impleme
|
||||
patchPasswordWithToken(uuid: string, token: string, password: string): Observable<RemoteData<EPerson>> {
|
||||
const requestId = this.requestService.generateRequestId();
|
||||
|
||||
const operation = Object.assign({ op: 'add', path: '/password', value: { 'password': password } });
|
||||
const operation = Object.assign({ op: 'add', path: '/password', value: { 'new_password': password } });
|
||||
|
||||
const hrefObs = this.halService.getEndpoint(this.linkPath).pipe(
|
||||
map((endpoint: string) => this.getIDHref(endpoint, uuid)),
|
||||
|
@@ -219,7 +219,7 @@ describe('ProfilePageComponent', () => {
|
||||
component.setCurrentPasswordValue('current-password');
|
||||
|
||||
operations = [
|
||||
{ 'op': 'add', 'path': '/password', 'value': { 'password': 'testest', 'challenge': 'current-password' } }
|
||||
{ 'op': 'add', 'path': '/password', 'value': { 'new_password': 'testest', 'current_password': 'current-password' } }
|
||||
];
|
||||
result = component.updateSecurity();
|
||||
});
|
||||
@@ -243,7 +243,7 @@ describe('ProfilePageComponent', () => {
|
||||
component.setInvalid(false);
|
||||
component.setCurrentPasswordValue('current-password');
|
||||
operations = [
|
||||
{ 'op': 'add', 'path': '/password', 'value': {'password': 'testest', 'challenge': 'current-password' }}
|
||||
{ 'op': 'add', 'path': '/password', 'value': {'new_password': 'testest', 'current_password': 'current-password' }}
|
||||
];
|
||||
result = component.updateSecurity();
|
||||
epersonService.patch(user, operations).subscribe((response) => {
|
||||
|
@@ -147,7 +147,7 @@ export class ProfilePageComponent implements OnInit {
|
||||
}
|
||||
if (!this.invalidSecurity && passEntered) {
|
||||
const operations = [
|
||||
{ 'op': 'add', 'path': '/password', 'value': { 'password': this.password, 'challenge': this.currentPassword } }
|
||||
{ 'op': 'add', 'path': '/password', 'value': { 'new_password': this.password, 'current_password': this.currentPassword } }
|
||||
] as Operation[];
|
||||
this.epersonService.patch(this.currentUser, operations).pipe(getFirstCompletedRemoteData()).subscribe((response: RemoteData<EPerson>) => {
|
||||
if (response.hasSucceeded) {
|
||||
|
Reference in New Issue
Block a user