From 06025e42e027b51c1757ffc9705ac91099d68ced Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 Feb 2024 16:53:30 +0100 Subject: [PATCH] embed the item to submission patch request to fix issue where the submission form would revert to the previous data on save --- src/app/core/json-patch/json-patch-operations.service.spec.ts | 4 ++-- src/app/core/json-patch/json-patch-operations.service.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/core/json-patch/json-patch-operations.service.spec.ts b/src/app/core/json-patch/json-patch-operations.service.spec.ts index 10fc2f2ed84..3fba1c6cf69 100644 --- a/src/app/core/json-patch/json-patch-operations.service.spec.ts +++ b/src/app/core/json-patch/json-patch-operations.service.spec.ts @@ -147,7 +147,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(); @@ -237,7 +237,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(); diff --git a/src/app/core/json-patch/json-patch-operations.service.ts b/src/app/core/json-patch/json-patch-operations.service.ts index 1dfbd404cc6..1b37665f220 100644 --- a/src/app/core/json-patch/json-patch-operations.service.ts +++ b/src/app/core/json-patch/json-patch-operations.service.ts @@ -18,6 +18,7 @@ import { getFirstCompletedRemoteData } from '../shared/operators'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RemoteData } from '../data/remote-data'; import { CoreState } from '../core-state.model'; +import { URLCombiner } from '../url-combiner/url-combiner'; /** * An abstract class that provides methods to make JSON Patch requests. @@ -125,7 +126,7 @@ export abstract class JsonPatchOperationsService