refactor: Use objectionjs instead of knex for factories

This commit is contained in:
Faruk AYDIN
2024-02-13 01:49:40 +01:00
parent 697f72ecf4
commit 95f89ba03e
9 changed files with 19 additions and 22 deletions

View File

@@ -1,3 +1,4 @@
import Execution from '../../src/models/execution';
import { createFlow } from './flow';
export const createExecution = async (params = {}) => {
@@ -6,10 +7,7 @@ export const createExecution = async (params = {}) => {
params.createdAt = params?.createdAt || new Date().toISOString();
params.updatedAt = params?.updatedAt || new Date().toISOString();
const [execution] = await global.knex
.table('executions')
.insert(params)
.returning('*');
const execution = await Execution.query().insert(params).returning('*');
return execution;
};