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[],
|
steps: AutomationStep[],
|
||||||
helpers: Joi.CustomHelpers
|
helpers: Joi.CustomHelpers
|
||||||
) => {
|
) => {
|
||||||
for (let i = 0; i < steps.length - 1; i++) {
|
for (const step of steps.slice(0, -1)) {
|
||||||
if (steps[i].stepId === AutomationActionStepId.BRANCH) {
|
if (step.stepId === AutomationActionStepId.BRANCH) {
|
||||||
return helpers.error("branchStepPosition")
|
return helpers.error("branchStepPosition")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue