1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-14 09:04:38 +00:00

fix ProjectEntityHandler.replaceFile

This commit is contained in:
Hayden Faulds 2017-11-27 17:10:20 +00:00
parent 3466db0aae
commit 9736513f59

View file

@ -224,9 +224,9 @@ module.exports = ProjectEntityHandler =
replaceFile: (project_id, file_id, fsPath, userId, callback)->
self = ProjectEntityHandler
ProjectGetter.getProject project_id, {name:true}, (err, project) ->
FileStoreHandler.uploadFileFromDisk project_id, file_id, fsPath, (err)->
return callback(err) if err?
FileStoreHandler.uploadFileFromDisk project._id, file_id, fsPath, (err)->
ProjectGetter.getProject project_id, {rootFolder: true, name:true}, (err, project) ->
return callback(err) if err?
# Note there is a potential race condition here (and elsewhere)
# If the file tree changes between findElement and the Project.update