Fix delete event on DS soft delete (#2032)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-15 14:18:37 +02:00
committed by GitHub
parent 6caa1fbd13
commit 54ae7f1f1b

View File

@@ -236,9 +236,12 @@ public class JpaDistributionSetManagement implements DistributionSetManagement {
// soft delete assigned // soft delete assigned
if (!assigned.isEmpty()) { if (!assigned.isEmpty()) {
final Long[] dsIds = assigned.toArray(new Long[0]); distributionSetRepository.saveAll(
distributionSetRepository.deleteDistributionSet(dsIds); setsFound.stream()
targetFilterQueryRepository.unsetAutoAssignDistributionSetAndActionTypeAndAccessContext(dsIds); .filter(set -> assigned.contains(set.getId()))
.peek(toSoftDelete -> toSoftDelete.setDeleted(true))
.toList());
targetFilterQueryRepository.unsetAutoAssignDistributionSetAndActionTypeAndAccessContext(assigned.toArray(new Long[0]));
} }
// mark the rest as hard delete // mark the rest as hard delete