mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 01:52:02 +00: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() {
|
getRandomId() {
|
||||||
return require('crypto')
|
return require('crypto')
|
||||||
.createHash('sha1')
|
.createHash('sha1')
|
||||||
|
|
Loading…
Reference in a new issue