copyFileFromExistingProject does not need the whole project

This commit is contained in:
Henry Oswald 2016-02-23 15:34:31 +00:00
parent 6f474d9a00
commit 1d76850ebd
2 changed files with 3 additions and 1 deletions

View file

@ -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)=>

View file

@ -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)=>