mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 02:33:47 +00:00
Merge pull request #422 from sharelatex/hof-resync-deleted-projects
404 when resyncing deleting projects
This commit is contained in:
commit
4accae6b2f
2 changed files with 12 additions and 3 deletions
|
@ -319,7 +319,7 @@ module.exports = ProjectEntityUpdateHandler = self =
|
|||
ProjectGetter.getProject project_id, rootFolder: true, overleaf: true, (error, project) ->
|
||||
return callback(error) if error?
|
||||
|
||||
if !project.overleaf?.history?.id?
|
||||
if !project?.overleaf?.history?.id?
|
||||
error = new Errors.ProjectHistoryDisabledError("project history not enabled for #{project_id}")
|
||||
return callback(error)
|
||||
|
||||
|
@ -335,8 +335,7 @@ module.exports = ProjectEntityUpdateHandler = self =
|
|||
path: file.path
|
||||
url: FileStoreHandler._buildUrl(project_id, file.file._id)
|
||||
|
||||
DocumentUpdaterHandler.resyncProjectHistory project_id, docs, files, callback
|
||||
|
||||
DocumentUpdaterHandler.resyncProjectHistory project_id, docs, files, callback
|
||||
_cleanUpEntity: (project, entity, entityType, path, userId, callback = (error) ->) ->
|
||||
if(entityType.indexOf("file") != -1)
|
||||
self._cleanUpFile project, entity, path, userId, callback
|
||||
|
|
|
@ -746,6 +746,16 @@ describe 'ProjectEntityUpdateHandler', ->
|
|||
.should.equal true
|
||||
|
||||
describe "resyncProjectHistory", ->
|
||||
describe "a deleted project", ->
|
||||
beforeEach ->
|
||||
@ProjectGetter.getProject = sinon.stub().yields()
|
||||
|
||||
@ProjectEntityUpdateHandler.resyncProjectHistory project_id, @callback
|
||||
|
||||
it "should return an error", ->
|
||||
error = new Errors.ProjectHistoryDisabledError("project history not enabled for #{project_id}")
|
||||
@callback.calledWith(error).should.equal true
|
||||
|
||||
describe "a project without project-history enabled", ->
|
||||
beforeEach ->
|
||||
@project.ovreleaf = {}
|
||||
|
|
Loading…
Reference in a new issue