mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-14 18:04:16 +00:00
send projectHistoryId with resync requests
This commit is contained in:
parent
3006d018d9
commit
9ef40902ca
2 changed files with 6 additions and 4 deletions
|
@ -121,11 +121,11 @@ module.exports = DocumentUpdaterHandler =
|
|||
method: "DELETE"
|
||||
}, project_id, "delete-thread", callback
|
||||
|
||||
resyncProjectHistory: (project_id, docs, files, callback) ->
|
||||
resyncProjectHistory: (project_id, projectHistoryId, docs, files, callback) ->
|
||||
logger.info {project_id, docs, files}, "resyncing project history in doc updater"
|
||||
DocumentUpdaterHandler._makeRequest {
|
||||
path: "/project/#{project_id}/history/resync"
|
||||
json: { docs, files }
|
||||
json: { docs, files, projectHistoryId }
|
||||
method: "POST"
|
||||
}, project_id, "resync-project-history", callback
|
||||
|
||||
|
|
|
@ -394,7 +394,8 @@ module.exports = ProjectEntityUpdateHandler = self =
|
|||
ProjectGetter.getProject project_id, rootFolder: true, overleaf: true, (error, project) ->
|
||||
return callback(error) if error?
|
||||
|
||||
if !project?.overleaf?.history?.id?
|
||||
projectHistoryId = project?.overleaf?.history?.id
|
||||
if !projectHistoryId?
|
||||
error = new Errors.ProjectHistoryDisabledError("project history not enabled for #{project_id}")
|
||||
return callback(error)
|
||||
|
||||
|
@ -410,7 +411,8 @@ 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, projectHistoryId, docs, files, callback
|
||||
|
||||
_cleanUpEntity: (project, entity, entityType, path, userId, callback = (error) ->) ->
|
||||
if(entityType.indexOf("file") != -1)
|
||||
self._cleanUpFile project, entity, path, userId, callback
|
||||
|
|
Loading…
Add table
Reference in a new issue