Skip to content

Commit c2aabcb

Browse files
committed
fix: validation
1 parent dc4a668 commit c2aabcb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/documents/create-document.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type DocumentData = {
55
name: string;
66
key: string;
77
storageType: DocumentStorageType;
8-
contentType: string; // actual file mime type
8+
contentType: string | null; // actual file mime type
99
supportedFileType: string; // papermark types: "pdf", "sheet", "docs", "slides", "map", "zip"
1010
fileSize: number | undefined; // file size in bytes
1111
numPages?: number;

lib/zod/url-validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const documentUploadSchema = z
144144
.enum(["S3_PATH", "VERCEL_BLOB"], {
145145
errorMap: () => ({ message: "Invalid storage type" }),
146146
})
147-
.optional(),
147+
.default("VERCEL_BLOB"),
148148
numPages: z.number().int().positive().optional(),
149149
type: z.enum(
150150
SUPPORTED_DOCUMENT_SIMPLE_TYPES as unknown as readonly [
@@ -169,7 +169,7 @@ export const documentUploadSchema = z
169169
},
170170
)
171171
.or(z.literal("text/html")) // Allow text/html for Notion documents
172-
.optional(), // Make contentType optional for Notion files
172+
.nullable(), // Make contentType optional for Notion files
173173
createLink: z.boolean().optional(),
174174
fileSize: z.number().int().positive().optional(),
175175
})

0 commit comments

Comments
 (0)