mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
27 lines
593 B
TypeScript
27 lines
593 B
TypeScript
import type { User } from '@prisma/client';
|
|
import { FolderType } from '@prisma/client';
|
|
|
|
import { prisma } from '..';
|
|
import type { Prisma } from '../client';
|
|
|
|
type CreateFolderOptions = {
|
|
type?: string;
|
|
createFolderOptions?: Partial<Prisma.FolderUncheckedCreateInput>;
|
|
};
|
|
|
|
export const seedBlankFolder = async (
|
|
user: User,
|
|
teamId: number,
|
|
options: CreateFolderOptions = {},
|
|
) => {
|
|
return await prisma.folder.create({
|
|
data: {
|
|
name: 'My folder',
|
|
userId: user.id,
|
|
teamId,
|
|
type: FolderType.DOCUMENT,
|
|
...options.createFolderOptions,
|
|
},
|
|
});
|
|
};
|