Some checks are pending
Automatisch Backend Tests / test (push) Waiting to run
Automatisch CI / linter (push) Waiting to run
Automatisch CI / start-backend-server (push) Waiting to run
Automatisch CI / start-backend-worker (push) Waiting to run
Automatisch CI / build-web (push) Waiting to run
Automatisch UI Tests / test (push) Waiting to run
13 lines
378 B
JavaScript
13 lines
378 B
JavaScript
import Folder from '../../src/models/folder.js';
|
|
import { faker } from '@faker-js/faker';
|
|
import { createUser } from './user';
|
|
|
|
export const createFolder = async (params = {}) => {
|
|
params.userId = params?.userId || (await createUser()).id;
|
|
params.name = params?.name || faker.lorem.word();
|
|
|
|
const folder = await Folder.query().insertAndFetch(params);
|
|
|
|
return folder;
|
|
};
|