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 Step from '../../src/models/step';
import { createFlow } from './flow';
export const createStep = async (params = {}) => {
@@ -16,7 +17,7 @@ export const createStep = async (params = {}) => {
params.appKey =
params?.appKey || (params.type === 'action' ? 'deepl' : 'webhook');
const [step] = await global.knex.table('steps').insert(params).returning('*');
const step = await Step.query().insert(params).returning('*');
return step;
};