refactor: update accepted file types for CSV uploads in import form and schema

This commit is contained in:
2025-11-13 13:14:52 +01:00
parent bcbac2998c
commit 4650be830b
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -1,9 +1,13 @@
import { z } from "zod"
const ACCEPTED_MIME_TYPES = ["text/csv", "text/comma-separated-values"]
export const importSchema = z.object({
file: z.instanceof(File).refine((file) => file.type === "text/csv", {
message: "File must be a CSV",
}),
file: z
.instanceof(File)
.refine((file) => ACCEPTED_MIME_TYPES.includes(file.type), {
message: "File must be a CSV",
}),
categoryId: z.string().optional(),
})