mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Improve handling of upload to deleted folder (#16738)
GitOrigin-RevId: 2ad2890f8fe51f3c7c7a8ac0834059ea9cb0557b
This commit is contained in:
@@ -653,6 +653,9 @@ const ProjectEntityUpdateHandler = {
|
||||
{ project_id: projectId, element_id: folderId, type: 'folder' },
|
||||
(error, folder, folderPath) => {
|
||||
if (error != null) {
|
||||
if (error instanceof Errors.NotFoundError && folder == null) {
|
||||
return callback(new Error('folder_not_found'))
|
||||
}
|
||||
return callback(error)
|
||||
}
|
||||
if (folder == null) {
|
||||
@@ -842,6 +845,9 @@ const ProjectEntityUpdateHandler = {
|
||||
{ project_id: projectId, element_id: folderId, type: 'folder' },
|
||||
(error, folder) => {
|
||||
if (error != null) {
|
||||
if (error instanceof Errors.NotFoundError && folder == null) {
|
||||
return callback(new Error('folder_not_found'))
|
||||
}
|
||||
return callback(error)
|
||||
}
|
||||
if (folder == null) {
|
||||
|
||||
@@ -120,6 +120,11 @@ module.exports = ProjectUploadController = {
|
||||
success: false,
|
||||
error: 'project_has_too_many_files',
|
||||
})
|
||||
} else if (error.message === 'folder_not_found') {
|
||||
return res.status(422).json({
|
||||
success: false,
|
||||
error: 'folder_not_found',
|
||||
})
|
||||
} else {
|
||||
return res.status(422).json({ success: false })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user