Update packages/server/src/api/routes/utils/validators.ts
Co-authored-by: Sam Rose <hello@samwho.dev>
This commit is contained in:
parent
f6f6120e70
commit
8c7aecfa22
|
@ -298,8 +298,8 @@ const validateStepsArray = (
|
|||
steps: AutomationStep[],
|
||||
helpers: Joi.CustomHelpers
|
||||
) => {
|
||||
for (let i = 0; i < steps.length - 1; i++) {
|
||||
if (steps[i].stepId === AutomationActionStepId.BRANCH) {
|
||||
for (const step of steps.slice(0, -1)) {
|
||||
if (step.stepId === AutomationActionStepId.BRANCH) {
|
||||
return helpers.error("branchStepPosition")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue