Skip to content

Commit

Permalink
Merge remote-tracking branch 'atmire-github/fix-submission-lost-chang…
Browse files Browse the repository at this point in the history
…es-after-save-7.6' into fix-submission-lost-changes-after-save-8.0.0-next
  • Loading branch information
artlowel committed Apr 19, 2024
2 parents e96ca2f + 06025e4 commit d03c640
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/core/json-patch/json-patch-operations.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('JsonPatchOperationsService test suite', () => {
});

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.flush();

Expand Down Expand Up @@ -246,7 +246,7 @@ describe('JsonPatchOperationsService test suite', () => {
});

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.flush();

Expand Down
3 changes: 2 additions & 1 deletion src/app/core/json-patch/json-patch-operations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
} from './json-patch-operations.actions';
import { JsonPatchOperationsResourceEntry } from './json-patch-operations.reducer';
import { jsonPatchOperationsByResourceType } from './selectors';
import { URLCombiner } from '../url-combiner/url-combiner';

/**
* An abstract class that provides methods to make JSON Patch requests.
Expand Down Expand Up @@ -144,7 +145,7 @@ export abstract class JsonPatchOperationsService<ResponseDefinitionDomain, Patch
* instance of 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 {
Expand Down

0 comments on commit d03c640

Please sign in to comment.