Make next step ID nullable (ability to save multiple edges without next steps)

[MAILPOET-5586]
This commit is contained in:
Jan Jakes
2023-09-15 15:24:53 +02:00
committed by Aschepikov
parent 32e5d4f8ac
commit f55c4f7755
12 changed files with 35 additions and 28 deletions

View File

@@ -78,7 +78,8 @@ class DuplicateAutomationController {
$step->getKey(),
$step->getArgs(),
array_map(function (NextStep $nextStep) use ($newIds): NextStep {
return new NextStep($newIds[$nextStep->getId()]);
$nextStepId = $nextStep->getId();
return new NextStep($nextStepId ? $newIds[$nextStepId] : null);
}, $step->getNextSteps())
);
}