mirror of
https://github.com/documenso/documenso.git
synced 2026-06-22 04:12:06 +10:00
23 lines
584 B
TypeScript
23 lines
584 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,
|
|
},
|
|
});
|
|
};
|