refactor: Use objection instead of knex for factories
This commit is contained in:
@@ -4,10 +4,8 @@ import { createFlow } from './flow';
|
||||
export const createExecution = async (params = {}) => {
|
||||
params.flowId = params?.flowId || (await createFlow()).id;
|
||||
params.testRun = params?.testRun || false;
|
||||
params.createdAt = params?.createdAt || new Date().toISOString();
|
||||
params.updatedAt = params?.updatedAt || new Date().toISOString();
|
||||
|
||||
const execution = await Execution.query().insert(params).returning('*');
|
||||
const execution = await Execution.query().insertAndFetch(params);
|
||||
|
||||
return execution;
|
||||
};
|
||||
|
Reference in New Issue
Block a user