Small progress on new (file/folder) and remove in project settings

This commit is contained in:
2024-11-19 23:30:43 +01:00
parent 9c52494f8e
commit 6e7243982b
7 changed files with 51 additions and 25 deletions

View File

@@ -1,14 +1,16 @@
import { z } from "zod";
export const fileType = z.enum(['folder', 'file', 'markdown', 'canvas']);
export const schema = z.object({
path: z.string(),
owner: z.number().finite(),
title: z.string(),
type: z.enum(['folder', 'file', 'markdown', 'canvas']),
type: fileType,
content: z.string(),
navigable: z.boolean(),
private: z.boolean(),
order: z.number().finite(),
});
export type FileType = z.infer<typeof fileType>;
export type File = z.infer<typeof schema>;

View File

@@ -1,10 +1,11 @@
import { z } from "zod";
import { fileType } from "./file";
export const single = z.object({
path: z.string(),
owner: z.number().finite(),
title: z.string(),
type: z.enum(['folder', 'file', 'markdown', 'canvas']),
type: fileType,
navigable: z.boolean(),
private: z.boolean(),
order: z.number().finite(),

View File

@@ -1,11 +1,12 @@
import { z } from "zod";
import { fileType } from "./file";
const baseItem = z.object({
path: z.string(),
parent: z.string(),
name: z.string().optional(),
title: z.string(),
type: z.enum(['folder', 'file', 'markdown', 'canvas']),
type: fileType,
navigable: z.boolean(),
private: z.boolean(),
order: z.number().finite(),