fix: Adjust get step with test executions SQL query
This commit is contained in:
@@ -16,14 +16,13 @@ const getStepWithTestExecutions = async (
|
|||||||
|
|
||||||
const previousStepsWithCurrentStep = await context.currentUser
|
const previousStepsWithCurrentStep = await context.currentUser
|
||||||
.$relatedQuery('steps')
|
.$relatedQuery('steps')
|
||||||
.withGraphJoined('executionSteps')
|
.withGraphFetched('executionSteps')
|
||||||
|
.modifyGraph('executionSteps', (builder) => {
|
||||||
|
builder.orderBy('created_at', 'desc').limit(1);
|
||||||
|
})
|
||||||
.where('flow_id', '=', step.flowId)
|
.where('flow_id', '=', step.flowId)
|
||||||
.andWhere('position', '<', step.position)
|
.andWhere('position', '<', step.position)
|
||||||
.distinctOn('executionSteps.step_id')
|
.orderBy('steps.position', 'asc');
|
||||||
.orderBy([
|
|
||||||
'executionSteps.step_id',
|
|
||||||
{ column: 'executionSteps.created_at', order: 'desc' },
|
|
||||||
]);
|
|
||||||
|
|
||||||
return previousStepsWithCurrentStep;
|
return previousStepsWithCurrentStep;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user