Update file types and add note (#559)
This commit is contained in:
parent
9dcdb7b50b
commit
fdd0acef59
1 changed files with 4 additions and 7 deletions
|
|
@ -11,13 +11,10 @@ const FileSchema = z.object({
|
||||||
.refine((file) => file.size <= 5 * 1024 * 1024, {
|
.refine((file) => file.size <= 5 * 1024 * 1024, {
|
||||||
message: 'File size should be less than 5MB',
|
message: 'File size should be less than 5MB',
|
||||||
})
|
})
|
||||||
.refine(
|
// Update the file type based on the kind of files you want to accept
|
||||||
(file) =>
|
.refine((file) => ['image/jpeg', 'image/png'].includes(file.type), {
|
||||||
['image/jpeg', 'image/png', 'application/pdf'].includes(file.type),
|
message: 'File type should be JPEG or PNG',
|
||||||
{
|
}),
|
||||||
message: 'File type should be JPEG, PNG, or PDF',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export async function POST(request: Request) {
|
export async function POST(request: Request) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue