mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
embed the item to submission patch request to fix issue where the submission form would revert to the previous data on save
This commit is contained in:
@@ -147,7 +147,7 @@ describe('JsonPatchOperationsService test suite', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should send a new SubmissionPatchRequest', () => {
|
it('should send a new SubmissionPatchRequest', () => {
|
||||||
const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref, patchOpBody);
|
const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref + '?embed=item', patchOpBody);
|
||||||
scheduler.schedule(() => service.jsonPatchByResourceType(resourceEndpoint, resourceScope, testJsonPatchResourceType).subscribe());
|
scheduler.schedule(() => service.jsonPatchByResourceType(resourceEndpoint, resourceScope, testJsonPatchResourceType).subscribe());
|
||||||
scheduler.flush();
|
scheduler.flush();
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ describe('JsonPatchOperationsService test suite', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should send a new SubmissionPatchRequest', () => {
|
it('should send a new SubmissionPatchRequest', () => {
|
||||||
const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref, patchOpBody);
|
const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref + '?embed=item', patchOpBody);
|
||||||
scheduler.schedule(() => service.jsonPatchByResourceID(resourceEndpoint, resourceScope, testJsonPatchResourceType, testJsonPatchResourceId).subscribe());
|
scheduler.schedule(() => service.jsonPatchByResourceID(resourceEndpoint, resourceScope, testJsonPatchResourceType, testJsonPatchResourceId).subscribe());
|
||||||
scheduler.flush();
|
scheduler.flush();
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@ import { getFirstCompletedRemoteData } from '../shared/operators';
|
|||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { CoreState } from '../core-state.model';
|
import { CoreState } from '../core-state.model';
|
||||||
|
import { URLCombiner } from '../url-combiner/url-combiner';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract class that provides methods to make JSON Patch requests.
|
* An abstract class that provides methods to make JSON Patch requests.
|
||||||
@@ -125,7 +126,7 @@ export abstract class JsonPatchOperationsService<ResponseDefinitionDomain, Patch
|
|||||||
* instance of PatchRequestDefinition
|
* instance of PatchRequestDefinition
|
||||||
*/
|
*/
|
||||||
protected getRequestInstance(uuid: string, href: string, body?: any): PatchRequestDefinition {
|
protected getRequestInstance(uuid: string, href: string, body?: any): PatchRequestDefinition {
|
||||||
return new this.patchRequestConstructor(uuid, href, body);
|
return new this.patchRequestConstructor(uuid, new URLCombiner(href, '?embed=item').toString(), body);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getEndpointByIDHref(endpoint, resourceID): string {
|
protected getEndpointByIDHref(endpoint, resourceID): string {
|
||||||
|
Reference in New Issue
Block a user