Update packages/server/src/api/routes/utils/validators.ts

Co-authored-by: Sam Rose <hello@samwho.dev>
This commit is contained in:
Peter Clement 2024-09-03 21:14:28 +01:00 committed by GitHub
parent f6f6120e70
commit 8c7aecfa22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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")
}
}