[#1651] Add SoftwareModule and DistributionSet unlock (REST) (#1677)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-03-08 11:28:24 +02:00
committed by GitHub
parent 4d104873de
commit ce9918ce00
10 changed files with 57 additions and 65 deletions

View File

@@ -286,8 +286,11 @@ public class JpaDistributionSetManagement implements DistributionSetManagement {
update.getDescription().ifPresent(set::setDescription);
update.getVersion().ifPresent(set::setVersion);
if (Boolean.TRUE.equals(update.getLocked()) && !set.isLocked()) {
// lock/unlock ONLY if locked flag is present!
if (Boolean.TRUE.equals(update.locked())) {
set.lock();
} else if (Boolean.FALSE.equals(update.locked())) {
set.unlock();
}
if (update.isRequiredMigrationStep() != null

View File

@@ -142,8 +142,12 @@ public class JpaSoftwareModuleManagement implements SoftwareModuleManagement {
update.getDescription().ifPresent(module::setDescription);
update.getVendor().ifPresent(module::setVendor);
if (Boolean.TRUE.equals(update.getLocked()) && !module.isLocked()) {
// lock/unlock ONLY if locked flag is present!
if (Boolean.TRUE.equals(update.locked())) {
module.lock();
} else if (Boolean.FALSE.equals(update.locked())) {
module.unlock();
}
return softwareModuleRepository.save(module);