diff --git a/services/web/app/coffee/Features/Editor/EditorHttpController.coffee b/services/web/app/coffee/Features/Editor/EditorHttpController.coffee index 86acfb79fe..97f61e9b86 100644 --- a/services/web/app/coffee/Features/Editor/EditorHttpController.coffee +++ b/services/web/app/coffee/Features/Editor/EditorHttpController.coffee @@ -57,6 +57,18 @@ module.exports = EditorHttpController = return next(error) if error? res.send 204 + deleteDoc: (req, res, next)-> + req.params.entity_type = "doc" + EditorHttpController.deleteEntity(req, res, next) + + deleteFile: (req, res, next)-> + req.params.entity_type = "file" + EditorHttpController.deleteEntity(req, res, next) + + deleteFolder: (req, res, next)-> + req.params.entity_type = "folder" + EditorHttpController.deleteEntity(req, res, next) + deleteEntity: (req, res, next) -> project_id = req.params.Project_id entity_id = req.params.entity_id diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index 31932fdc23..8538e16bf8 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -103,7 +103,10 @@ module.exports = class Router app.post '/project/:Project_id/:entity_type/:entity_id/rename', SecurityManager.requestCanModifyProject, EditorHttpController.renameEntity app.post '/project/:Project_id/:entity_type/:entity_id/move', SecurityManager.requestCanModifyProject, EditorHttpController.moveEntity - app.delete '/project/:Project_id/:entity_type/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteEntity + + app.delete '/project/:Project_id/file/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteFile + app.delete '/project/:Project_id/doc/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteDoc + app.delete '/project/:Project_id/folder/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteFolder app.post '/project/:Project_id/compile', SecurityManager.requestCanAccessProject, CompileController.compile app.get '/Project/:Project_id/output/output.pdf', SecurityManager.requestCanAccessProject, CompileController.downloadPdf