mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-07 01:02:09 +00:00
return a 400 status code for invalid moves
was previously returning 500
This commit is contained in:
parent
cd2688a740
commit
b30dd22f0e
1 changed files with 6 additions and 2 deletions
|
@ -128,7 +128,11 @@ module.exports = EditorHttpController =
|
||||||
folder_id = req.body.folder_id
|
folder_id = req.body.folder_id
|
||||||
user_id = AuthenticationController.getLoggedInUserId(req)
|
user_id = AuthenticationController.getLoggedInUserId(req)
|
||||||
EditorController.moveEntity project_id, entity_id, folder_id, entity_type, user_id, (error) ->
|
EditorController.moveEntity project_id, entity_id, folder_id, entity_type, user_id, (error) ->
|
||||||
return next(error) if error?
|
if error?.message == 'destination folder is a child folder of me'
|
||||||
|
res.status(400).json(req.i18n.translate('invalid_file_name'))
|
||||||
|
else if error?
|
||||||
|
next(error)
|
||||||
|
else
|
||||||
res.sendStatus 204
|
res.sendStatus 204
|
||||||
|
|
||||||
deleteDoc: (req, res, next)->
|
deleteDoc: (req, res, next)->
|
||||||
|
|
Loading…
Reference in a new issue