mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
copyFileFromExistingProject does not need the whole project
This commit is contained in:
parent
6f474d9a00
commit
1d76850ebd
2 changed files with 3 additions and 1 deletions
|
@ -183,7 +183,7 @@ module.exports = ProjectEntityHandler =
|
|||
callback()
|
||||
|
||||
copyFileFromExistingProject: (project_or_id, folder_id, originalProject_id, origonalFileRef, callback = (error, fileRef, folder_id) ->)->
|
||||
Project.getProject project_or_id, "", (err, project) ->
|
||||
Project.getProject project_or_id, "name", (err, project) ->
|
||||
logger.log project_id:project._id, folder_id:folder_id, originalProject_id:originalProject_id, origonalFileRef:origonalFileRef, "copying file in s3"
|
||||
return callback(err) if err?
|
||||
confirmFolder project, folder_id, (folder_id)=>
|
||||
|
|
|
@ -872,6 +872,8 @@ describe 'ProjectEntityHandler', ->
|
|||
filePath = "dumpFolder/somewhere/image.jpeg"
|
||||
oldProject_id = "123kljadas"
|
||||
oldFileRef = {name:fileName, _id:"oldFileRef"}
|
||||
beforeEach ->
|
||||
@ProjectModel.getProject = (project_id, fields, callback)=> callback(null, {name:@project.name, _id:@project._id})
|
||||
|
||||
it 'should copy the file in FileStoreHandler', (done)->
|
||||
@ProjectEntityHandler.copyFileFromExistingProject project_id, folder_id, oldProject_id, oldFileRef, (err, fileRef, parentFolder)=>
|
||||
|
|
Loading…
Reference in a new issue