mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
[web] gracefully handle empty relativePath in uppy uploads (#36773)
GitOrigin-RevId: 640094f69cf53ba9f33a5bdc3b6d532547431d01
This commit is contained in:
@@ -29,7 +29,7 @@ const uploadProjectSchema = z.object({
|
||||
body: z.strictObject({
|
||||
name: z.string().nonempty(),
|
||||
type: uploadMetaTypeSchema,
|
||||
relativePath: zz.filepath().optional(),
|
||||
relativePath: zz.filepath().or(z.literal('')).optional(),
|
||||
}),
|
||||
file: zz.uploadedFile(),
|
||||
})
|
||||
@@ -47,7 +47,7 @@ const uploadFileSchema = z.object({
|
||||
// {success:false, error:'invalid_filename'} response instead of a
|
||||
// generic validation error
|
||||
name: z.string().optional(),
|
||||
relativePath: zz.filepath().optional(),
|
||||
relativePath: zz.filepath().or(z.literal('')).optional(),
|
||||
type: uploadMetaTypeSchema,
|
||||
targetFolderId: zz.objectId().optional(),
|
||||
}),
|
||||
@@ -63,7 +63,7 @@ const importDocumentSchema = z.object({
|
||||
}),
|
||||
body: z.strictObject({
|
||||
name: z.string().nonempty(),
|
||||
relativePath: zz.filepath().optional(),
|
||||
relativePath: zz.filepath().or(z.literal('')).optional(),
|
||||
type: uploadMetaTypeSchema,
|
||||
}),
|
||||
file: zz.uploadedFile(),
|
||||
|
||||
Reference in New Issue
Block a user