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 Flow from '../../src/models/flow';
import { createUser } from './user';
export const createFlow = async (params = {}) => {
@@ -6,7 +7,7 @@ export const createFlow = async (params = {}) => {
params.createdAt = params?.createdAt || new Date().toISOString();
params.updatedAt = params?.updatedAt || new Date().toISOString();
const [flow] = await global.knex.table('flows').insert(params).returning('*');
const flow = await Flow.query().insert(params).returning('*');
return flow;
};