mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Renamed prepareBody to uriEncodeBody
This commit is contained in:
@@ -161,7 +161,7 @@ export class RequestService {
|
||||
/**
|
||||
* Convert request Payload to a URL-encoded string
|
||||
*
|
||||
* e.g. prepareBody({param: value, param1: value1})
|
||||
* e.g. uriEncodeBody({param: value, param1: value1})
|
||||
* returns: param=value¶m1=value1
|
||||
*
|
||||
* @param body
|
||||
@@ -169,7 +169,7 @@ export class RequestService {
|
||||
* @return string
|
||||
* URL-encoded string
|
||||
*/
|
||||
public prepareBody(body: any) {
|
||||
public uriEncodeBody(body: any) {
|
||||
let queryParams = '';
|
||||
if (isNotEmpty(body) && typeof body === 'object') {
|
||||
Object.keys(body)
|
||||
|
@@ -66,7 +66,7 @@ describe('ClaimedTaskDataService', () => {
|
||||
};
|
||||
|
||||
spyOn(service, 'postToEndpoint');
|
||||
requestService.prepareBody.and.returnValue(body);
|
||||
requestService.uriEncodeBody.and.returnValue(body);
|
||||
|
||||
service.approveTask(scopeId);
|
||||
|
||||
@@ -85,7 +85,7 @@ describe('ClaimedTaskDataService', () => {
|
||||
};
|
||||
|
||||
spyOn(service, 'postToEndpoint');
|
||||
requestService.prepareBody.and.returnValue(body);
|
||||
requestService.uriEncodeBody.and.returnValue(body);
|
||||
|
||||
service.rejectTask(reason, scopeId);
|
||||
|
||||
|
@@ -70,7 +70,7 @@ export class ClaimedTaskDataService extends TasksService<ClaimedTask> {
|
||||
const body = {
|
||||
submit_approve: 'true'
|
||||
};
|
||||
return this.postToEndpoint(this.linkPath, this.requestService.prepareBody(body), scopeId, this.makeHttpOptions());
|
||||
return this.postToEndpoint(this.linkPath, this.requestService.uriEncodeBody(body), scopeId, this.makeHttpOptions());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ export class ClaimedTaskDataService extends TasksService<ClaimedTask> {
|
||||
submit_reject: 'true',
|
||||
reason
|
||||
};
|
||||
return this.postToEndpoint(this.linkPath, this.requestService.prepareBody(body), scopeId, this.makeHttpOptions());
|
||||
return this.postToEndpoint(this.linkPath, this.requestService.uriEncodeBody(body), scopeId, this.makeHttpOptions());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -8,7 +8,7 @@ export function getMockRequestService(requestEntry$: Observable<RequestEntry> =
|
||||
generateRequestId: 'clients/b186e8ce-e99c-4183-bc9a-42b4821bdb78',
|
||||
getByHref: requestEntry$,
|
||||
getByUUID: requestEntry$,
|
||||
prepareBody: jasmine.createSpy('prepareBody'),
|
||||
uriEncodeBody: jasmine.createSpy('uriEncodeBody'),
|
||||
/* tslint:disable:no-empty */
|
||||
removeByHrefSubstring: () => {}
|
||||
/* tslint:enable:no-empty */
|
||||
|
Reference in New Issue
Block a user