feat: validate step input in executeFlow

This commit is contained in:
Ali BARIN
2023-03-12 11:28:33 +00:00
parent 7b3f070973
commit 9b8ec9b85e

View File

@@ -13,11 +13,13 @@ const executeFlow = async (
context: Context context: Context
) => { ) => {
const { stepId } = params.input; const { stepId } = params.input;
const { executionStep } = await testRun({ stepId });
const untilStep = await context.currentUser const untilStep = await context.currentUser
.$relatedQuery('steps') .$relatedQuery('steps')
.findById(stepId); .findById(stepId)
.throwIfNotFound();
const { executionStep } = await testRun({ stepId });
if (executionStep.isFailed) { if (executionStep.isFailed) {
throw new Error(JSON.stringify(executionStep.errorDetails)); throw new Error(JSON.stringify(executionStep.errorDetails));