diff --git a/services/web/app/coffee/Features/Project/ProjectDuplicator.coffee b/services/web/app/coffee/Features/Project/ProjectDuplicator.coffee index 208b218b0c..bf775caeeb 100644 --- a/services/web/app/coffee/Features/Project/ProjectDuplicator.coffee +++ b/services/web/app/coffee/Features/Project/ProjectDuplicator.coffee @@ -17,7 +17,7 @@ module.exports = ProjectDuplicator = projectEntityHandler.setRootDoc newProject._id, doc_id jobs = originalFolder.docs.map (doc)-> - return (callback)-> + return (cb)-> content = docContents[doc._id.toString()] projectEntityHandler.addDocWithProject newProject, desFolder._id, doc.name, content.lines, (err, newDoc)-> if err? @@ -25,7 +25,7 @@ module.exports = ProjectDuplicator = return callback(err) if originalRootDoc? and newDoc.name == originalRootDoc.name setRootDoc newDoc._id - callback() + cb() async.series jobs, callback