mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[FixturesManager] add a helper for setting up project and doc together
This commit is contained in:
parent
65eed4138e
commit
2900c60c4a
1 changed files with 16 additions and 0 deletions
|
@ -109,6 +109,22 @@ module.exports = FixturesManager = {
|
|||
})
|
||||
},
|
||||
|
||||
setUpEditorSession(options, callback) {
|
||||
FixturesManager.setUpProject(options, (err, detailsProject) => {
|
||||
if (err) return callback(err)
|
||||
|
||||
FixturesManager.setUpDoc(
|
||||
detailsProject.project_id,
|
||||
options,
|
||||
(err, detailsDoc) => {
|
||||
if (err) return callback(err)
|
||||
|
||||
callback(null, Object.assign({}, detailsProject, detailsDoc))
|
||||
}
|
||||
)
|
||||
})
|
||||
},
|
||||
|
||||
getRandomId() {
|
||||
return require('crypto')
|
||||
.createHash('sha1')
|
||||
|
|
Loading…
Reference in a new issue