22 lines
795 B
TypeScript
22 lines
795 B
TypeScript
import { faker } from '@faker-js/faker';
|
|
import type { ProjectListItem, ProjectSharingData, ProjectType } from '@/types/projects.types';
|
|
import { ProjectTypes } from '@/types/projects.types';
|
|
|
|
export const createProjectSharingData = (projectType?: ProjectType): ProjectSharingData => ({
|
|
id: faker.string.uuid(),
|
|
name: faker.lorem.words({ min: 1, max: 3 }),
|
|
type: projectType ?? ProjectTypes.Personal,
|
|
createdAt: faker.date.past().toISOString(),
|
|
updatedAt: faker.date.recent().toISOString(),
|
|
});
|
|
|
|
export const createProjectListItem = (projectType?: ProjectType): ProjectListItem => {
|
|
const project = createProjectSharingData(projectType);
|
|
return {
|
|
...project,
|
|
role: 'project:editor',
|
|
createdAt: faker.date.past().toISOString(),
|
|
updatedAt: faker.date.recent().toISOString(),
|
|
};
|
|
};
|