[FixturesManager] add a helper for setting up project and doc together

This commit is contained in:
Jakob Ackermann 2020-10-01 12:33:15 +01:00
parent 65eed4138e
commit 2900c60c4a

View file

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