Merge pull request #2017 from automatisch/AUT-1094
fix(update-flow-status): throw at incomplete trigger step
This commit is contained in:
@@ -112,6 +112,13 @@ class Flow extends Base {
|
||||
return lastExecutions.map((execution) => execution.internalId);
|
||||
}
|
||||
|
||||
get IncompleteStepsError() {
|
||||
return new ValidationError({
|
||||
message: 'All steps should be completed before updating flow status!',
|
||||
type: 'incompleteStepsError',
|
||||
});
|
||||
}
|
||||
|
||||
async $beforeUpdate(opt, queryContext) {
|
||||
await super.$beforeUpdate(opt, queryContext);
|
||||
|
||||
@@ -124,10 +131,7 @@ class Flow extends Base {
|
||||
});
|
||||
|
||||
if (incompleteStep) {
|
||||
throw new ValidationError({
|
||||
message: 'All steps should be completed before updating flow status!',
|
||||
type: 'incompleteStepsError',
|
||||
});
|
||||
throw this.IncompleteStepsError;
|
||||
}
|
||||
|
||||
const allSteps = await oldFlow.$relatedQuery('steps');
|
||||
|
Reference in New Issue
Block a user