Merge pull request #4746 from overleaf/ae-project-history

Add endpoint for migrating a project from track-changes to full project history

GitOrigin-RevId: 74e1fb1379a78a9569dda2007e677a4d277e38fb
This commit is contained in:
Brian Gough
2021-10-28 10:52:33 +01:00
committed by Copybot
parent d9d65ac31c
commit da4fdfe11e
8 changed files with 219 additions and 721 deletions

View File

@@ -70,7 +70,15 @@ const ProjectHistoryHandler = {
)
},
upgradeHistory(project_id, callback) {
unsetHistory(project_id, callback) {
return Project.updateOne(
{ _id: project_id },
{ $unset: { 'overleaf.history': true } },
callback
)
},
upgradeHistory(project_id, allowDowngrade, callback) {
// project must have an overleaf.history.id before allowing display of new history
if (callback == null) {
callback = function () {}
@@ -80,6 +88,7 @@ const ProjectHistoryHandler = {
{
'overleaf.history.display': true,
'overleaf.history.upgradedAt': new Date(),
'overleaf.history.allowDowngrade': allowDowngrade,
},
function (err, result) {
if (err != null) {