Merge pull request #2378 from overleaf/bg-return-history-display-type-to-docupdater

return history display type to docupdater

GitOrigin-RevId: bc90317677937c4f0698c2045958b79820ec3b3f
This commit is contained in:
Brian Gough
2019-11-21 14:54:43 +00:00
committed by sharelatex
parent 78f6148ca1
commit fb0f8ec65f
2 changed files with 20 additions and 10 deletions
@@ -17,6 +17,7 @@ const ProjectLocator = require('../Project/ProjectLocator')
const ProjectEntityHandler = require('../Project/ProjectEntityHandler')
const ProjectEntityUpdateHandler = require('../Project/ProjectEntityUpdateHandler')
const logger = require('logger-sharelatex')
const _ = require('lodash')
module.exports = {
getDocument(req, res, next) {
@@ -69,19 +70,20 @@ module.exports = {
res.type('text/plain')
return res.send(lines.join('\n'))
} else {
const projectHistoryId = __guard__(
__guard__(
project != null ? project.overleaf : undefined,
x2 => x2.history
),
x1 => x1.id
const projectHistoryId = _.get(project, 'overleaf.history.id')
const projectHistoryType = _.get(
project,
'overleaf.history.display'
)
? 'project-history'
: undefined // for backwards compatibility, don't send anything if the project is still on track-changes
return res.json({
lines,
version,
ranges,
pathname: path.fileSystem,
projectHistoryId
projectHistoryId,
projectHistoryType
})
}
})