fix: Fetch lastStep directly on the step factory
This commit is contained in:
@@ -5,7 +5,7 @@ export const createStep = async (params: Partial<Step> = {}) => {
|
|||||||
params.flowId = params?.flowId || (await createFlow()).id;
|
params.flowId = params?.flowId || (await createFlow()).id;
|
||||||
params.type = params?.type || 'action';
|
params.type = params?.type || 'action';
|
||||||
|
|
||||||
const [lastStep] = await global.knex
|
const lastStep = await global.knex
|
||||||
.table('steps')
|
.table('steps')
|
||||||
.where('flowId', params.flowId)
|
.where('flowId', params.flowId)
|
||||||
.andWhere('deletedAt', '!=', null)
|
.andWhere('deletedAt', '!=', null)
|
||||||
|
Reference in New Issue
Block a user