From c5d5131f0bf7b8f1c3abe704b40b6871cc12a6d5 Mon Sep 17 00:00:00 2001 From: Rudra Chopra Date: Tue, 17 Dec 2024 15:26:19 +0530 Subject: [PATCH] fix(Rest): License overview is not updating in summary page. Signed-off-by: Rudra Chopra --- .../sw360/rest/resourceserver/release/ReleaseController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/release/ReleaseController.java b/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/release/ReleaseController.java index 6c011f71ec..823fe76c34 100644 --- a/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/release/ReleaseController.java +++ b/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/release/ReleaseController.java @@ -1264,12 +1264,14 @@ public ResponseEntity writeSpdxLicenseInfoIntoRelease( Set otherLicenseIds = licensesInfoInRequestBody.get("otherLicenseIds"); if (!CommonUtils.isNullOrEmptyCollection(licenseIds)) { + sw360Release.getMainLicenseIds().clear(); for (String licenseId : licenseIds) { sw360Release.addToMainLicenseIds(licenseId); } } if (!CommonUtils.isNullOrEmptyCollection(otherLicenseIds)) { + sw360Release.getOtherLicenseIds().clear(); for (String licenseId : otherLicenseIds) { sw360Release.addToOtherLicenseIds(licenseId); } @@ -1686,7 +1688,6 @@ private HalResource createHalReleaseResource(Release release, boolean v } if (release.getMainLicenseIds() != null) { restControllerHelper.addEmbeddedLicenses(halRelease, release.getMainLicenseIds()); - release.setMainLicenseIds(null); } if (release.getOtherLicenseIds() != null) { restControllerHelper.addEmbeddedOtherLicenses(halRelease, release.getOtherLicenseIds());